Click to See Complete Forum and Search --> : form tag expanding table too much


essjay_d12
02-28-2006, 12:47 PM
Hi I have the follwoing table


<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="38" width="35" valign="top" background="http://localhost/dvdreviewer/images/siteGraphics/TableHeader/mainStrip.jpg"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="418" height="38" valign="top"><form id="form1" name="form1" method="post" action="" class="Search">
Search
<input type="text" name="textfield" />
</form></td>
</tr>
</table>


But it seems to increase my tables height to more than 38 px (only when the form tag in included- this needs to be included).
Does anyone know how to control it or prevent the table from increasing to more than 38px it needs to be exact as it contains background image.

thANKS

D

the tree
02-28-2006, 01:02 PM
You really don't want to be using tables for layout. They bring up accessability, flexibility and SEO issues that you can just do without. You'll find things a lot easier if you use CSS (http://www.htmlhelp.com/reference/css/) for presentation and leave HTML for document structure.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<style type="text/css">
<!--
form#form1{
display: block;
width: 428px;
padding: 3px;
font: 12px serif;
border: 1px solid #888;
text-align: center;
}
input{
height: 16px;
font-size: 12px;
border-width: 1px;
margin: 0;
padding: 0;
}
-->
</style>
</head>
<body>
<form id="form1" method="post" action="" class="Search">
<label for="texfield">Search</label>
<input type="text" name="textfield">
<input type="submit" value="Search">
</form>
</body>
</html>

essjay_d12
02-28-2006, 01:17 PM
ok but i have layed it out in tables now, so is there a way around it when using tables?

D

felgall
02-28-2006, 01:22 PM
Simply change the margins and padding for the form to zero.

form {margin:0;padding:0}

Charles
02-28-2006, 01:27 PM
And note that The Tree, while completely correct that you ought not to be using tables for layout, has nonetheless used invalid HTML in the example. You example is also invalid.