Vertical Alignment

Discussion in 'HTML' started by Jim Heavey, Mar 2, 2004.

  1. Jim Heavey

    Jim Heavey Guest

    If I have a table and i want to vertically center the information in a
    single cell, How would I do this?

    Thanks in advance for your assistance!!!!!!!!!


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    Jim Heavey, Mar 2, 2004
    #1
    1. Advertising

  2. Jim Heavey

    Steve R. Guest

    Jim Heavey wrote in message ...
    > If I have a table and i want to vertically center the information in a
    > single cell, How would I do this?


    I use this ...

    valign="middle"
    Steve R., Mar 2, 2004
    #2
    1. Advertising

  3. Jim Heavey wrote:

    > If I have a table and i want to vertically center the information in a
    > single cell, How would I do this?


    vertical-align: middle;

    applied to that cell using which even technique you prefer, such as a class
    selector or id selector.

    See also http://dorward.me.uk/www/css/#tutorials

    It does seem odd that you only want to change this presentation on one cell,
    are you perhaps abusing table data cells as a layout hack?

    http://www.allmyfaqs.com/faq.pl?Tableless_layouts

    --
    David Dorward <http://dorward.me.uk/>
    David Dorward, Mar 2, 2004
    #3
  4. Jim Heavey

    Els Guest

    Jim Heavey wrote:

    > If I have a table and i want to vertically center the information in a
    > single cell, How would I do this?
    >
    > Thanks in advance for your assistance!!!!!!!!!


    eh.. it should by default center vertically already...

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Els, Mar 2, 2004
    #4
  5. Jim Heavey

    Kris Guest

    In article <4044deb5$0$41754$>,
    Els <> wrote:

    > > If I have a table and i want to vertically center the information in a
    > > single cell, How would I do this?
    > >
    > > Thanks in advance for your assistance!!!!!!!!!

    >
    > eh.. it should by default center vertically already...


    In some browsers. In others it doesn't.
    Use CSS vertical-align property on the table cell. If you don't mind to
    burn in hell, use the valign attribute on the cell.

    --
    Kris
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Mar 2, 2004
    #5
  6. Jim Heavey

    Els Guest

    Kris wrote:

    > In article <4044deb5$0$41754$>,
    > Els <> wrote:
    >
    >
    >>>If I have a table and i want to vertically center the information in a
    >>>single cell, How would I do this?
    >>>
    >>>Thanks in advance for your assistance!!!!!!!!!

    >>
    >>eh.. it should by default center vertically already...

    >
    > In some browsers. In others it doesn't.


    Didn't know that. In which browsers it doesn't? (will have
    to check my own pages again in those)

    > Use CSS vertical-align property on the table cell. If you don't mind to
    > burn in hell, use the valign attribute on the cell.


    Well, I would mind, actually, it's just that I feel being
    'burned' in alt.html isn't very much like hell ;-)

    (but I still use CSS instead, just for my own comfort)

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Els, Mar 2, 2004
    #6
  7. Els <> wrote:

    >>>eh.. it should by default center vertically already...

    >>
    >> In some browsers. In others it doesn't.

    >
    > Didn't know that. In which browsers it doesn't?


    If a table cell is not vertically centered by default, then the browser
    violates the HTML 4 specification. I don't know of any such browser.

    Oddly enough, HTML 4 does not use SGML to specify the default (the DTD
    says just #IMPLIED) but the prose says it very clearly:

    "middle: Cell data is centered vertically within the cell. This is the
    default value."

    http://www.w3.org/TR/html4/struct/tables.html#adef-valign

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Mar 2, 2004
    #7
  8. Jim Heavey

    Kris Guest

    In article <4044e1de$0$41754$>,
    Els <> wrote:

    > >>>If I have a table and i want to vertically center the information in a
    > >>>single cell, How would I do this?
    > >>
    > >>eh.. it should by default center vertically already...

    > >
    > > In some browsers. In others it doesn't.

    >
    > Didn't know that. In which browsers it doesn't? (will have
    > to check my own pages again in those)


    I have to apologize for a too quick conclusion. I remember seeing at
    least one (old) browser (could have been one of the Netscape 4 family)
    that put it at the top of a cell by default. I could have misled myself.

    Jukka's reply clears it up, also for me.

    However, not that the default would matter much if one would use tables
    for what they are made for.

    Again, my apologies.

    > > Use CSS vertical-align property on the table cell. If you don't mind to
    > > burn in hell, use the valign attribute on the cell.

    >
    > Well, I would mind, actually, it's just that I feel being
    > 'burned' in alt.html isn't very much like hell ;-)


    Actually, it was more of a hint to the OP, not you. I know you are a
    Bearer Of The Light.

    --
    Kris
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Mar 3, 2004
    #8
  9. Jim Heavey

    Els Guest

    Kris wrote:

    > In article <4044e1de$0$41754$>,
    > Els <> wrote:


    [snip too many apologies ;-)]

    >>>Use CSS vertical-align property on the table cell. If you don't mind to
    >>>burn in hell, use the valign attribute on the cell.

    >>
    >>Well, I would mind, actually, it's just that I feel being
    >>'burned' in alt.html isn't very much like hell ;-)

    >
    > Actually, it was more of a hint to the OP, not you.


    Yeah, I figured that, just felt like replying anyway :)

    > I know you are a Bearer Of The Light.


    lol

    Didn't see (or read) any LOTR, but it sounds like a term
    from there :-D

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Els, Mar 3, 2004
    #9
  10. Jim Heavey

    Kris Guest

    In article <40459d4c$0$41746$>,
    Els <> wrote:

    > [snip too many apologies ;-)]


    And you have too many smileys in your posts! :p

    > > I know you are a Bearer Of The Light.

    >
    > lol
    >
    > Didn't see (or read) any LOTR, but it sounds like a term
    > from there :-D


    Now that you mention it, yes. I recall Gandalf the wizard is called
    something like that. Are you, like some of my friends, the kind that
    refuses to see the movie before reading the book but just doesn't have
    the time to start reading? Teehee.

    --
    Kris
    <> (nl)
    <http://www.cinnamon.nl/>
    Kris, Mar 3, 2004
    #10
  11. Jim Heavey

    Els Guest

    Kris wrote:

    > In article <40459d4c$0$41746$>,
    > Els <> wrote:
    >
    >>[snip too many apologies ;-)]

    >
    > And you have too many smileys in your posts! :p


    I noticed... :-( ;-) :-D

    >>>I know you are a Bearer Of The Light.

    >>
    >>lol
    >>
    >>Didn't see (or read) any LOTR, but it sounds like a term
    >>from there :-D

    >
    > Now that you mention it, yes. I recall Gandalf the wizard is called
    > something like that. Are you, like some of my friends, the kind that
    > refuses to see the movie before reading the book but just doesn't have
    > the time to start reading? Teehee.


    No, it's not that, more like I don't think I will like the
    book/story/film enough to make an effort at sitting down to
    read/see it...

    Saw Finding Nemo last Saturday though.
    My excuse: two little kids. (no smiley here)

    --
    Els

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
    Els, Mar 3, 2004
    #11
    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. dba56
    Replies:
    0
    Views:
    831
    dba56
    Apr 14, 2005
  2. Luc
    Replies:
    2
    Views:
    411
    Sid Ismail
    Jan 19, 2004
  3. Nik Coughin

    Vertical alignment in a div

    Nik Coughin, Jan 21, 2004, in forum: HTML
    Replies:
    9
    Views:
    5,323
    Nik Coughin
    Jan 28, 2004
  4. Arondelle
    Replies:
    12
    Views:
    768
    Spartanicus
    Jul 18, 2004
  5. Jakob Rohde

    Vertical alignment of a form

    Jakob Rohde, Jan 8, 2005, in forum: HTML
    Replies:
    11
    Views:
    2,341
    Toby Inkster
    Jan 9, 2005
Loading...

Share This Page