25
01
2006


How to suppress extra vertical space after HTML forms
Posted by: Andrei in HTML, ProgrammingTypical formatting of all HTML 4.0 FORM tag has a strange behavior when it contains a table cell inside. A strange vertical space appears after the FORM, even there is no <BR> or something else there.
Here is the a typical behavior:
and the code is:
<table style="text-align: left; background-color: #336699; width: 300px;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td>
<form name="example1">
<table style="text-align: left; background-color: #ffffff; width: 100%;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><small><span style="font-family: Tahoma;">Email:</span></small></td>
<td><input name="text1" value="just a test"/></td>
</tr>
<tr>
<td rowspan="1" colspan="2"><input name="Submit" value="Submit" type="submit"/></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<tr>
<td>
<form name="example1">
<table style="text-align: left; background-color: #ffffff; width: 100%;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><small><span style="font-family: Tahoma;">Email:</span></small></td>
<td><input name="text1" value="just a test"/></td>
</tr>
<tr>
<td rowspan="1" colspan="2"><input name="Submit" value="Submit" type="submit"/></td>
</tr>
</table>
</form>
</td>
</tr>
</table>