Jump to content

php help


apw

Recommended Posts

 

hello

 

  hello, Im trying to do a break in my code that allows the seperation of table elements such as:

 

print "<table class='maintable'><tr class='headline'><td><center>Main Menu</center></td></tr>";
      print "<tr class='mainrow'><td>Civil</a></td></tr>";
      print "<tr class='mainrow'><td><A href='economics.php'>Economics</a></td></tr>";
      print "<tr class='mainrow'><td><A href='buildings.php'>Buildings</a></td></tr>";
      print "<tr class='mainrow'><td><A href='landuse.php'>Land Use</a></td></tr>";
      print "<tr class='mainrow'><td><A href='society.php'>Society</a></td></tr>";
      print "<tr class='mainrow'><td><A href='resources.php'>Resource Management</td></tr><br>";    

-- break here for seperation--

print "<tr class='mainrow'><td>Military</a></td></tr>";
      print "<tr class='mainrow'><td><A href='attack.php'>Attack</a></td></tr>";
      print "<tr class='mainrow'><td><A href='Espionage.php'>Espionage</a></td></tr>";
      print "<tr class='mainrow'><td><A href='units.php'>Units</a></td></tr>";
      print "<tr class='mainrow'><td><A href='officers.php'>Officers</a></td></tr>";
      print "<tr class='mainrow'><td><A href='history.php'>Attack History</a></td></tr>";
      print "</td></tr>";

 

There should be a break between the resource management and the military section.  I've tried to do a print "<br>"; and it pulls the entire table down.

 

Thanks for your help

Link to comment
Share on other sites

 

hello

 

hello, Im trying to do a break in my code that allows the seperation of table elements such as:

 

print "<table class='maintable'><tr class='headline'><td><center>Main Menu</center></td></tr>";
     print "<tr class='mainrow'><td>Civil</a></td></tr>";
     print "<tr class='mainrow'><td><A href='economics.php'>Economics</a></td></tr>";
     print "<tr class='mainrow'><td><A href='buildings.php'>Buildings</a></td></tr>";
     print "<tr class='mainrow'><td><A href='landuse.php'>Land Use</a></td></tr>";
     print "<tr class='mainrow'><td><A href='society.php'>Society</a></td></tr>";
     print "<tr class='mainrow'><td><A href='resources.php'>Resource Management</td></tr><br>";    

-- break here for seperation--

print "<tr class='mainrow'><td>Military</a></td></tr>";
     print "<tr class='mainrow'><td><A href='attack.php'>Attack</a></td></tr>";
     print "<tr class='mainrow'><td><A href='Espionage.php'>Espionage</a></td></tr>";
     print "<tr class='mainrow'><td><A href='units.php'>Units</a></td></tr>";
     print "<tr class='mainrow'><td><A href='officers.php'>Officers</a></td></tr>";
     print "<tr class='mainrow'><td><A href='history.php'>Attack History</a></td></tr>";
     print "</td></tr>";

 

There should be a break between the resource management and the military section. I've tried to do a print "<br>"; and it pulls the entire table down.

 

Thanks for your help

You cannot add a newline (<br />) between two table rows. You should apply padding/margin to the required row(s) instead, eg change

print "<tr class='mainrow'><td>Military</a></td></tr>";

to

print "<tr class='mainrow header'><td>Military</a></td></tr>";

Now apply the following style in your CSS

tr.header {
  margin-top: 20px;
  padding: 0;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.