Vertically centering a form in a table

J

JonABurgess

I am trying to put a google search form into a table but I cannot get
it to align vertically. There is a space below the form that I can't
find the source of. This code below is for a table with 'rounded
corners'. The form starts immediately after the top corners but there
is a space below it before the bottom corners start. Anyone have any
ideas as to why this is?



<table align="center" border="0" cellpadding="0" cellspacing="0"
bgcolor=#4c4c4c>

<tr>
<td valign="top"><img src="tl.gif"></td>
<td></td>
<td valign="top"><img src="tr.gif"></td>
</tr>

<tr>
<td></td>

<td>
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<A HREF="http://www.google.com/"></a>
<INPUT TYPE=text name=q size=25 value="">
</FORM>
</td>

<td></td>
</tr>

<tr>
<td valign="bottom"><img src="bl.gif"></td>
<td></td>
<td valign="bottom"><img src="br.gif"></td>
</tr>

</table>
 
J

jojo

I am trying to put a google search form into a table but I cannot get
it to align vertically. There is a space below the form that I can't
find the source of. This code below is for a table with 'rounded
corners'. The form starts immediately after the top corners but there
is a space below it before the bottom corners start. Anyone have any
ideas as to why this is?



<table align="center" border="0" cellpadding="0" cellspacing="0"
bgcolor=#4c4c4c>

<tr>
<td valign="top"><img src="tl.gif"></td>
<td></td>
<td valign="top"><img src="tr.gif"></td>
</tr>

<tr>
<td></td>

<td>
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<A HREF="http://www.google.com/"></a>
<INPUT TYPE=text name=q size=25 value="">
</FORM>
</td>

<td></td>
</tr>

<tr>
<td valign="bottom"><img src="bl.gif"></td>
<td></td>
<td valign="bottom"><img src="br.gif"></td>
</tr>

</table>

Perhaps the form has got some margin or padding by default? Try to get
rid of it using CSS:

<style type="text/css">
form, input {margin:0px; padding:0px;}
</style>

But I'm not sure about form/form elements having a padding/margin or not...

BTW: Your form misses any "submit"-button...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top