Forum Moderators: open
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" class="bottomborder whiteback topbar valigntop">
<form name="search" action="searchglob.php" method="post"><input name="searchfor" type="text" class="formtxt" value="Search">
<input type="image" src="skin/search.png" value="Submit" alt="Search"></form>
</td>
</tr>
</table>
Basically the table looks fine when i code it in dreamweaver and preview it in there, but when I move to the browsers it looks different. There is a massive gap below the form <input type="texT">
I want the bottom of the table to be as flush as possible with the bottom of the form text input. Can anyone suggest anything?
I would appreciate it.
Thanks.
This seems to work for me:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>
Untitled
</title>
</head>
<body>
<div id="wrapper">
<table border="1" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" class="bottomborder whiteback topbar valigntop"><form name="search" action="searchglob.php" method="post">
<input name="searchfor" type="text" class="formtxt" value="Search">
<input type="image" src="skin/search.png" value="Submit" alt="Search">
</form></td>
</tr>
</table>
</div>
</body>
</html>
While not proper html, you could put the <form> and </form> tags outside the <table> and </table> tags
Nothing invalid about that. Just be sure to open the form element before the table starts and close it after the form element closes and you're valid. Or you can place the form element completely inside the table cell (<td>) and you're also valid.
Validation trouble comes from improper nesting, or from having the form element between a <tr> and a <td>
[edited by: tedster at 7:21 am (utc) on May 14, 2007]
When you say "There is a massive gap below the form <input type="texT">" you mean below the form'S input, and above the submit, or what? because it's not clear.
Lastly, when you say massive... how big is it approximately?
Not sure if this works, but you can try a universal reset (*{padding:0;border:0;margin:0} on either everything (and then manually give padding/margins tho the things you want padding/margins on), or specifically set all tds, trs,table, form, input, or whatever elements are causing you trouble to 0 padding, 0 margin.
Lastly... may I ask why you are using a 1-celled table? Why aren't you using a div or something?