OriginalSunny Posted March 24, 2006 Share Posted March 24, 2006 Hi,I am working on a webpage and can't seem to figure out why my output is comming out half way down the page. My [b].php[/b] file reads in the [b].inc[/b] file which contains the following coding:<form action="order_form.php?do=new" method="POST"> <?php if (isset($message_new)) echo "<tr><td colspan='2'><b>$message_new</b> </td></tr>";?><table border="0" cellpadding="5" cellspacing="0"><tr><td align="right"><b>Title</b></td> <td><input type="text" name="title" value="<?php echo @$title ?>" size="10" maxlength="10"></td></tr><br><br><tr><td align="right"><b>Surname</b></td> <td><input type="text" name="surname" value="<?php echo @$surname ?>" size="30" maxlength="30"></td></tr><br><br> .......... <tr><td align="center" colspan="2"> <input type="submit" value="Submit"></td></tr></table>I am fairly confident that the php file is not causing this problem. Can anyone see why it is doing this?? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 25, 2006 Share Posted March 25, 2006 Could it be that $message_new contains several empty lines? Quote Link to comment Share on other sites More sharing options...
OriginalSunny Posted March 25, 2006 Author Share Posted March 25, 2006 Its not that because when i get rid of echo"..$messagenew.." it doesnt make any difference. The only time it makes a difference is when i get rid of <table border="0" cellpadding="5" cellspacing="0">But i need the table to display the info in the correct places. I dont see anything wrong with my table command. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 25, 2006 Share Posted March 25, 2006 Do you have a URL where we could look at the results?Ken Quote Link to comment Share on other sites More sharing options...
Hooker Posted March 25, 2006 Share Posted March 25, 2006 try changing:[code]<tr><td colspan='2'><b>$message_new</b></td></tr>[/code]to just this:[code]<b>$message_new</b>[/code]unless "<b>$message_new</b>" is suposed to be set within the table, in which case its in the wrong place, seems to be that its creating 2 colums of an unset size so its just making them huge :/ Quote Link to comment Share on other sites More sharing options...
OriginalSunny Posted March 25, 2006 Author Share Posted March 25, 2006 I have tried that and it still makes no difference. The only time it makes a difference is when i get rid of:<table border="0" cellpadding="5" cellspacing="0">For some reason the table is created half way down the page. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 25, 2006 Share Posted March 25, 2006 Anything within <table>...</table> that isn't inside a cell will be output above the table.In your case you have several <br> placed outside table cells. Remove them.EG<tr><td align="right"><b>Title</b></td><td><input type="text" name="title"value="<?php echo @$title ?>"size="10" maxlength="10"></td></tr>[!--coloro:#FF6666--][span style=\"color:#FF6666\"][!--/coloro--]<br><br>[!--colorc--][/span][!--/colorc--] Quote Link to comment Share on other sites More sharing options...
OriginalSunny Posted March 25, 2006 Author Share Posted March 25, 2006 Its ok now. I have just recoded the page. I think the main problem was those <br> statements. Thanks. 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.