That error is incredibly easy to fix if you know the nesting rules of HTML. One of the reasons why using tables for page layout purposes is considered to be bad is the fact that they are composed of nested tags and one tag nesting mistake will confuse the browser and thus result in display issue in particular browsers. That's why the validator is so picky about tag nesting.
This is what you currently have:
<td width="44%" align="center" valign="top"><p><a href="http://www.autocareforum.com/t-shirts.html"><img src="images/140_banners/473.gif" alt="Forum T-Shirts" width="300" height="152" border="2" /></a></p><p> </p>
<table width="325" align="center" bgcolor="#FFCC00">
<form method="get" action="http://www.google.com/custom" >
<tr>
<td width="325" height="32" align="center" valign="top" nowrap="nowrap"><div align="center">
<input type="text" name="q" size="40" maxlength="255" value="" />
<input type="submit" name="sa" value="Go" />
<br />
<span class="edit-title">Google Search</span>
<input type="hidden" name="client" value="pub-3818261540992887" />
<input type="hidden" name="forid" value="1" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="hidden" name="oe" value="ISO-8859-1" />
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;" />
<input type="hidden" name="hl" value="en" />
</div></td>
</tr>
</form>
</table></td>
and this is how it should look like:
<td width="44%" align="center" valign="top"><p><a href="http://www.autocareforum.com/t-shirts.html">
<img src="images/140_banners/473.gif" alt="Forum T-Shirts" width="300" height="152" border="2" /></a></p>
<p></p>
<form method="get" action="http://www.google.com/custom" >
<table width="325" align="center" bgcolor="#FFCC00">
<tr>
<td width="325" height="32" align="center" valign="top" nowrap="nowrap">
<div align="center">
<input type="text" name="q" size="40" maxlength="255" value="" />
<input type="submit" name="sa" value="Go" />
<br />
<span class="edit-title">Google Search</span>
<input type="hidden" name="client" value="pub-3818261540992887" />
<input type="hidden" name="forid" value="1" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="hidden" name="oe" value="ISO-8859-1" />
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;" />
<input type="hidden" name="hl" value="en" />
</div>
</td>
</tr>
</table>
</form>
</td>
Note that I just put the form tag around the entire table element and added proper indentation for better readability of the code. The validator complained because you had tag soup in your code: by definition only the tags
<tbody> and
<tr> are allowed to reside directly within the
<table>-tag. Putting that
<form>-tag in is just wrong. Just moving the
<form>-tag one level up inside the HTML nesting puts everything right. As you can see, it's not that hard to get valid code if you know your HTML.
Finally, let me talk about the use of a separate table cell in above code: what is the use of the table suppossed to do: all table content resides within one table cell, so you don't use the feature of a table to nicely align various cells next to or on top of each other, so what's the deal? Finally, you warp the entire content of the table cell in yet another needless
<div>-container. Why's that? The entire search form can be handled so much easier if you just get rid of the table bullshit: replace the one-table cell-nonsense from above with
<td width="44%" align="center" valign="top"><p><a href="http://www.autocareforum.com/t-shirts.html">
<img src="images/140_banners/473.gif" alt="Forum T-Shirts" width="300" height="152" border="2" /></a></p>
<p></p>
<form method="get" action="http://www.google.com/custom" >
<div style="text-align:center; width:325px; height:32px; background-color:#FFCC00">
<input type="text" name="q" size="40" maxlength="255" value="" />
<input type="submit" name="sa" value="Go" />
<br />
<span class="edit-title">Google Search</span>
<input type="hidden" name="client" value="pub-3818261540992887" />
<input type="hidden" name="forid" value="1" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="hidden" name="oe" value="ISO-8859-1" />
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;" />
<input type="hidden" name="hl" value="en" />
</div>
</form>
</td>
Note that I have assigned all the deprecated formatting you had assigned for your table to the div container as CSS. You have to understand that there has never been a parameter "height" for the
<td>-tag. Microsoft just added support for that silly attribute back in IE4, and that's what beginners use from that day one. But it's bad. It's invalid. It's stupid. Don't use it.
One final design mistake is left in that cose: the useless starting and ending of a paragraph. Of course everybody understands why you are using it. In a human converstion, one would say "I understand what you're trying to say". But: a paragraph is not the correct method to create some space between the element on top and the element beneath it. You have no control over the height of such whitespace and not guarantee that there will be whitespace at all. The paragraph tag is a logical one (similar to the
<h1> to
<h6>-tags, not one you should use for design purposes. What you're trying to accomplish is making sure that in front of your little custom Google search form there will be some whitespace, so you should just do that: tie the command to the element in question by assigning properties to the
<form>-tag. Change the code from above to
<td width="44%" align="center" valign="top"><p><a href="http://www.autocareforum.com/t-shirts.html">
<img src="images/140_banners/473.gif" alt="Forum T-Shirts" width="300" height="152" border="2" /></a></p>
<form method="get" action="http://www.google.com/custom" style="margin-top:15px">
<div style="text-align:center; width:325px; height:32px; background-color:#FFCC00">
<input type="text" name="q" size="40" maxlength="255" value="" />
<input type="submit" name="sa" value="Go" />
<br />
<span class="edit-title">Google Search</span>
<input type="hidden" name="client" value="pub-3818261540992887" />
<input type="hidden" name="forid" value="1" />
<input type="hidden" name="ie" value="ISO-8859-1" />
<input type="hidden" name="oe" value="ISO-8859-1" />
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;" />
<input type="hidden" name="hl" value="en" />
</div>
</form>
</td>
and that should be it.
The discussion if you actually
need that custom search form (i.e. if your site visitors actually use it) is another thing: with all the ads on the site I'd mistake it with another advert if I were a regular user. The label "Google Search" is bad and misleading and will send users away from your page. You better change the label to "search Auto Care Forum" and change the custom search form definition to do a search on your site only, similar to the search on
http://documentation.coppermine-gallery.net/en/index.htm (hover your mouse over the "table of contents" block at the top left).