Vertically centering a form in a table

Discussion in 'HTML' started by JonABurgess@gmail.com, Jul 22, 2006.

  1. Guest

    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>
     
    , Jul 22, 2006
    #1
    1. Advertising

  2. jojo Guest

    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...
     
    jojo, Jul 22, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lenny
    Replies:
    1
    Views:
    457
    Andy Holmes
    Oct 16, 2003
  2. JustAnotherGuy
    Replies:
    0
    Views:
    447
    JustAnotherGuy
    Dec 8, 2003
  3. ChChanges
    Replies:
    2
    Views:
    868
    Mitja
    Jun 16, 2004
  4. Replies:
    1
    Views:
    502
  5. CRON
    Replies:
    9
    Views:
    441
Loading...

Share This Page