jack5100nv Posted March 8, 2010 Share Posted March 8, 2010 Ok, I have the following code. I want the form fields with the Submit button nicely tucked in the table row with bgcolor. However, whgen I view it in Firefox or IE8, I get extra space under the form fields (see screenshot). How can I remove that extra space. I tried Including the form in div tags and stuff but no luck. echo(" <br><br> <table align='center' cellpadding='0' cellspacing='0' width='780' valign='top'> <tr> <td bgcolor='#cccccc' align='right'> <form method='post' action='test.php'> <input type='text' size='15' name='searchtext'> <select name='cat'> <option value='1'>Test1</option> <option value='2'>Test2</option> <option value='3'>Test3</option> </select> <input type='submit' value=Submit> </form> </td> </tr> </table> "); [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/194538-how-can-i-remove-an-extra-line-break-or-spacing/ Share on other sites More sharing options...
wildteen88 Posted March 8, 2010 Share Posted March 8, 2010 This is more of a html/css issue than PHP. By default browsers tend to add margin/padding to form tags. Simply add the following css to your stylesheet to remove the margin/padding on forms form { margin: 0; padding: 0; } Link to comment https://forums.phpfreaks.com/topic/194538-how-can-i-remove-an-extra-line-break-or-spacing/#findComment-1023168 Share on other sites More sharing options...
Anti-Moronic Posted March 8, 2010 Share Posted March 8, 2010 If that doesn't work, you should get [anyway] webdeveloper plugin for firefox and use that. Then press cntrl + shift + f. This will allow you to hover over the space and find out exactly what is over-extending. It's very likely the form though. But this kind of inconsistent margin and padding can happen with other html elements. Link to comment https://forums.phpfreaks.com/topic/194538-how-can-i-remove-an-extra-line-break-or-spacing/#findComment-1023170 Share on other sites More sharing options...
sasa Posted March 8, 2010 Share Posted March 8, 2010 change <form method='post' action='test.php'> to <form method='post' action='test.php' style='display:inline;'> Link to comment https://forums.phpfreaks.com/topic/194538-how-can-i-remove-an-extra-line-break-or-spacing/#findComment-1023176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.