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
https://forums.phpfreaks.com/topic/121612-php-help/
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
https://forums.phpfreaks.com/topic/121612-php-help/#findComment-632091
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.