Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Vertically centering a form in a table

Reply
Thread Tools

Vertically centering a form in a table

 
 
JonABurgess@gmail.com
Guest
Posts: n/a
 
      07-22-2006
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>

 
Reply With Quote
 
 
 
 
jojo
Guest
Posts: n/a
 
      07-22-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) schrieb:
> 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...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
table vertically aligned centre on page ? CRON HTML 9 10-28-2006 03:10 PM
how can align the text vertically in a table cell atin45gupt@gmail.com HTML 1 01-17-2006 04:25 PM
How Do You Vertically Center a Table on a Webpage? ChChanges HTML 2 06-16-2004 07:14 AM
Re: Forcing table cells to stack vertically JustAnotherGuy HTML 0 12-08-2003 05:17 AM
Centering content horizontally AND vertically with CSS? Lenny HTML 1 10-15-2003 11:14 PM



Advertisments