apw Posted August 27, 2008 Share Posted August 27, 2008 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted August 27, 2008 Share Posted August 27, 2008 Output a row with empty cell spanning all columns and height set in CSS? Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted August 29, 2008 Share Posted August 29, 2008 This is why I hate table layouts. PHP + tables just don't go together. Quote Link to comment Share on other sites More sharing options...
haku Posted August 29, 2008 Share Posted August 29, 2008 I think outputting tables with PHP is easy enough, but this just isn't a good use of tables, as the data doesn't appear to be tabular data. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted August 29, 2008 Share Posted August 29, 2008 I don't see a single PHP variable or statement there except print. Why don't you just exit PHP mode and just dump the HTML? Unless that's a simplified example of something else. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted September 2, 2008 Share Posted September 2, 2008 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; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.