vertical-align: center

Discussion in 'HTML' started by Allison McGhee, Apr 13, 2006.

  1. I messed up this question what I meant to say was How can I do the
    equivalent of
    <table>
    <tr>
    <td valign="center>Img</td>
    <td valign="center">Header</td>
    </tr>
    </table>

    Sorry for the mistake
    A
     
    Allison McGhee, Apr 13, 2006
    #1
    1. Advertising

  2. Allison McGhee

    oeb Guest

    Allison McGhee wrote:
    > I messed up this question what I meant to say was How can I do the
    > equivalent of
    > <table>
    > <tr>
    > <td valign="center>Img</td>
    > <td valign="center">Header</td>
    > </tr>
    > </table>
    >
    > Sorry for the mistake
    > A
    >
    >


    vertical-align:middle;

    or in full

    *CSS*

    #mytable td {vertical-align:middle;}

    *HTML*

    <table id="mytable">
    <tr>
    <td valign="center>Img</td>
    <td valign="center">Header</td>
    </tr>
    </table>
     
    oeb, Apr 13, 2006
    #2
    1. Advertising

  3. Allison McGhee

    Steve Pugh Guest

    Allison McGhee wrote:
    > I messed up this question what I meant to say was How can I do the
    > equivalent of
    > <table>
    > <tr>
    > <td valign="center>Img</td>
    > <td valign="center">Header</td>
    > </tr>
    > </table>


    There is no equivalent as valign="center" doesn't exist.
    The only possible values of valign are top, middle, bottom and
    baseline.
    See http://www.w3.org/TR/html401/struct/tables.html#adef-valign

    If you mean valign="middle" (which is the default anyway) then the CSS
    equivalent is vertical-align: middle. Note that the vertical-align
    property only applies to some elements, so if you are also replacing
    your table cells with divs you can't use vertical-align in the same way
    that you used valign.

    Steve
     
    Steve Pugh, Apr 13, 2006
    #3
  4. Allison McGhee

    Neredbojias Guest

    To further the education of mankind, "Allison McGhee" <>
    declaimed:

    > I messed up this question what I meant to say was How can I do the
    > equivalent of
    > <table>
    > <tr>
    > <td valign="center>Img</td>
    > <td valign="center">Header</td>
    > </tr>
    > </table>
    >
    > Sorry for the mistake
    > A


    If you mean that you want to replace tables with divs, etc., there are a
    number of ways but all a little tricky. More information needed.

    --
    Neredbojias
    Infinity can have limits.
     
    Neredbojias, Apr 13, 2006
    #4
    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. Kay
    Replies:
    2
    Views:
    7,163
  2. Rabbit
    Replies:
    1
    Views:
    2,757
    Shimon Sim
    Feb 12, 2006
  3. shank

    vertical-align: bottom

    shank, Oct 2, 2003, in forum: HTML
    Replies:
    9
    Views:
    20,935
    brucie
    Oct 3, 2003
  4. Eirik Eldorsen
    Replies:
    17
    Views:
    12,503
    cosmic foo
    Aug 4, 2005
  5. Steve Richter
    Replies:
    1
    Views:
    903
    Mark Rae
    Jun 24, 2007
Loading...

Share This Page