wordsarefew Posted May 9, 2014 Share Posted May 9, 2014 hi, i am a total newbie. with some idiosyncratic knowledge of actionscript.. so please apologies if this has been answered before or if it so bleeding obvious.. trying searching but i dont really know what to search for.. why does this following simple code add space above the php code? it appears that every <tr> you add, the equivalent space appears above the php code: <html> <body> <table bgcolor="#FF9900" width="100%" border="0"> <tr> <td> <?php echo '<table width="100%"> <tr bgcolor="#FFFFF"> <td> say something </td><br/> <td> and something else</td> </tr> <tr bgcolor="#FFFFF"> <td> say something </td><br/> <td> and something else</td> </tr> <tr bgcolor="#FFFFF"> <td> say something </td><br/> <td> and something else</td> </tr> </table>' ?> </td> </tr> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/288375-newbie-php-code-with-html-table-sits-inside-html-table-adds-space-above/ Share on other sites More sharing options...
wordsarefew Posted May 9, 2014 Author Share Posted May 9, 2014 right. answer here: http://forums.phpfreaks.com/topic/288107-not-sure-how-to-position-these-tables/?hl=php+table&do=findComment&comment=1477674 Link to comment https://forums.phpfreaks.com/topic/288375-newbie-php-code-with-html-table-sits-inside-html-table-adds-space-above/#findComment-1478906 Share on other sites More sharing options...
requinix Posted May 9, 2014 Share Posted May 9, 2014 Every TR you add where? "Equivalent space"? Appears above the table that you're adding in the PHP code? Use your browser to see if the space is coming from a padding or margin, or potentially cell spacing or padding. That's the most likely cause. Link to comment https://forums.phpfreaks.com/topic/288375-newbie-php-code-with-html-table-sits-inside-html-table-adds-space-above/#findComment-1478907 Share on other sites More sharing options...
Ch0cu3r Posted May 9, 2014 Share Posted May 9, 2014 It is because of the <br/> that is outside of the <td></td> tags on lines (9, 13 and 17). Link to comment https://forums.phpfreaks.com/topic/288375-newbie-php-code-with-html-table-sits-inside-html-table-adds-space-above/#findComment-1478909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.