genzedu777 Posted January 16, 2011 Share Posted January 16, 2011 Hi all, 1) I realised after applying php's codes, the contents in 'panel 2' doesn't stay within 'panel 2', apparently the contents went outside of 'panel 2 <div>'. Attached is the picture example. Is there anything amiss which I have done? 2) Another thing, I realised the <td> is very far apart from the next <td>, example... if (!empty($row1['uni2'])) { echo '<tr><td class="label">Faculty or Course:</td><td>' . $row1['uni2'] . '</td></tr>'; } <td class="label">Faculty or Course:</td> is apparently very far apart from <td>' . $row1['uni2'] . '</td> As you can see it in the attachment. How do i close up the wide gap? Thanks echo '<div id="panel2">'; /***University***/ echo '<table>'; if (!empty($row1['uni1'])) { echo '<br/><tr><td class="row_header">' . $row1['uni1'] . '</td></tr>'; if (!empty($row1['uni2'])) { echo '<tr><td class="label">Faculty or Course:</td><td>' . $row1['uni2'] . '</td></tr>'; } if (!empty($row1['uni3'])) { echo '<tr><td class="label">Results:</td><td>' . $row1['uni3'] . '</td></tr>'; } } echo '</table>'; echo '</div>'; //End of Panel 2 [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/224609-table-content-went-out-of-alignment-after-apply-php-code/ Share on other sites More sharing options...
denno020 Posted January 16, 2011 Share Posted January 16, 2011 So this is revised code with PHP added? Can we see the code (HTML) you had before when it was working? Denno Quote Link to comment https://forums.phpfreaks.com/topic/224609-table-content-went-out-of-alignment-after-apply-php-code/#findComment-1160252 Share on other sites More sharing options...
genzedu777 Posted January 16, 2011 Author Share Posted January 16, 2011 Hi denno020, I didnt have the html code, I've started off with PHP code right away. Are you able to see any errors? Quote Link to comment https://forums.phpfreaks.com/topic/224609-table-content-went-out-of-alignment-after-apply-php-code/#findComment-1160258 Share on other sites More sharing options...
denno020 Posted January 16, 2011 Share Posted January 16, 2011 I would imagine it's something to do with CSS more than the code. Unless there are heaps of spaces printed or tab characters. Have you checked the source of the page in the browser to see if this is the case? You could try setting the table cell widths to a specific number and see if that helps.. Denno Quote Link to comment https://forums.phpfreaks.com/topic/224609-table-content-went-out-of-alignment-after-apply-php-code/#findComment-1160279 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.