CSS and center align

Discussion in 'HTML' started by shank, Sep 29, 2003.

  1. shank

    shank Guest

    I have a table cell with a nested table within.
    How do I center that nested table within that cell?

    I found { vertical-align:middle }
    But { horizontal-align:center } seems to be invalid

    Is it proper to use { text-align:center } ..?

    thanks
     
    shank, Sep 29, 2003
    #1
    1. Advertising

  2. shank

    SeeSchloss Guest

    "shank" a écrit :
    > I have a table cell with a nested table within.
    > How do I center that nested table within that cell?
    >
    > I found { vertical-align:middle }
    > But { horizontal-align:center } seems to be invalid
    >
    > Is it proper to use { text-align:center } ..?


    Yes, 'horizontal-align' does not exist.


    --
    SeeSchloß - http://www.seeschloss.net
     
    SeeSchloss, Sep 29, 2003
    #2
    1. Advertising

  3. shank wrote:

    > I have a table cell with a nested table within.


    That is _very_ odd tabular data.

    > How do I center that nested table within that cell?


    http://dorward.me.uk/www/centre/ - more complex then it needs to be thanks
    to MSIE.

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Sep 29, 2003
    #3
  4. shank

    brucie Guest

    In post <F72eb.31683$>
    shank said...

    > I have a table cell with a nested table within.
    > How do I center that nested table within that cell?


    don't use tables for layout. much easier and can achieve layouts not
    possible any other way with CSS

    > I found { vertical-align:middle }


    IME one of CSS great oversights was not to allow vertical-align on any
    element

    > But { horizontal-align:center } seems to be invalid


    you cant make things up and expect them to work

    > Is it proper to use { text-align:center } ..?


    horizontally yes. there is no one solution for vertically, depends on
    your design.

    --
    30/September/2003 08:20:42 am
     
    brucie, Sep 29, 2003
    #4
  5. shank

    DU Guest

    shank wrote:
    > I have a table cell with a nested table within.


    Avoid nested tables for positioning and layout.

    > How do I center that nested table within that cell?
    >


    text-align:center for inline elements; margin:0 auto for block-level
    elements.

    > I found { vertical-align:middle }
    > But { horizontal-align:center } seems to be invalid
    >
    > Is it proper to use { text-align:center } ..?
    >
    > thanks
    >
    >


    It is definitively not recommendable to use nested tables or just to use
    a single table for positioning elements or for webpage layout. You
    should use a table for tabular data otherwise you will make your page
    much more difficult to consult in several devices.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
     
    DU, Sep 29, 2003
    #5
  6. shank

    shank Guest

    "DU" <> wrote in message
    news:blad4f$ngp$...
    > shank wrote:
    > > I have a table cell with a nested table within.

    >
    > Avoid nested tables for positioning and layout.
    >
    > > How do I center that nested table within that cell?
    > >

    >
    > text-align:center for inline elements; margin:0 auto for block-level
    > elements.
    >
    > > I found { vertical-align:middle }
    > > But { horizontal-align:center } seems to be invalid
    > >
    > > Is it proper to use { text-align:center } ..?
    > >
    > > thanks
    > >
    > >

    >
    > It is definitively not recommendable to use nested tables or just to use
    > a single table for positioning elements or for webpage layout. You
    > should use a table for tabular data otherwise you will make your page
    > much more difficult to consult in several devices.
    >
    > DU
    > --
    > Javascript and Browser bugs:
    > http://www10.brinkster.com/doctorunclear/
    > - Resources, help and tips for Netscape 7.x users and Composer
    > - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    > http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html



    Nested tables have worked very well in the past and, until I get migrated to
    100% CSS, will work fine in the future. Since I've started researching the
    move to CSS I've noticed that many of the recommended sites for learning CSS
    still use tables. If it's so great, why not lose the tables altogether? Even
    the pros on the internet and in this newsgroup cannot agree on all aspects
    of CSS. For sure, our customers still have antiquated browsers. Although the
    upgrades are free, they are likely not going to upgrade very soon. That
    said, even if I was able to get 100% CSS, I'd have to account for all those
    old browsers somehow. Do I believe CSS will take over? Yep... just not as
    quick as some of you would like.
    This newsgroup is still great!
    Thanks!
     
    shank, Sep 30, 2003
    #6
  7. shank

    DU Guest

    shank wrote:

    > "DU" <> wrote in message
    > news:blad4f$ngp$...
    >
    >>shank wrote:
    >>
    >>>I have a table cell with a nested table within.

    >>
    >>Avoid nested tables for positioning and layout.
    >>
    >>
    >>>How do I center that nested table within that cell?
    >>>

    >>
    >>text-align:center for inline elements; margin:0 auto for block-level
    >>elements.
    >>
    >>
    >>>I found { vertical-align:middle }
    >>>But { horizontal-align:center } seems to be invalid
    >>>
    >>>Is it proper to use { text-align:center } ..?
    >>>
    >>>thanks
    >>>
    >>>

    >>
    >>It is definitively not recommendable to use nested tables or just to use
    >>a single table for positioning elements or for webpage layout. You
    >>should use a table for tabular data otherwise you will make your page
    >>much more difficult to consult in several devices.
    >>
    >>DU
    >>--
    >>Javascript and Browser bugs:
    >>http://www10.brinkster.com/doctorunclear/
    >>- Resources, help and tips for Netscape 7.x users and Composer
    >>- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    >>http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html

    >
    >
    >
    > Nested tables have worked very well in the past and, until I get migrated to
    > 100% CSS, will work fine in the future.


    We are talking about nested tables here. Try them with screen readers,
    voice browsers, text-to-speech devices, printing, (handheld/wireless
    media) mobile phone, etc...

    Since I've started researching the
    > move to CSS I've noticed that many of the recommended sites for learning CSS
    > still use tables.


    1) Are we talking about
    Tables or
    nested tables?
    2) Are we talking about using a non-nested table for tabular data or are
    we talking about using table(s) for positioning and layout?

    Report back in this thread when you can clarify these questions along
    with your "many of the recommended sites".

    Here's a few for starters:

    http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-avoid-table-for-layout
    http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-table-layout
    http://www.w3.org/TR/WAI-WEBCONTENT-TECHS/#tech-avoid-table-for-layout
    WAI HTML Table Linearizer Entry Form
    http://www.w3.org/WAI/References/Tablin/form


    If it's so great, why not lose the tables altogether? Even
    > the pros on the internet and in this newsgroup cannot agree on all aspects
    > of CSS. For sure, our customers still have antiquated browsers.


    So? Content should degrade in case CSS is not supported.
    13 Using style sheet positioning and markup to transform gracefully
    http://www.w3.org/TR/WCAG10-CSS-TECHS/#style-transform-gracefully

    Although the
    > upgrades are free, they are likely not going to upgrade very soon. That
    > said, even if I was able to get 100% CSS, I'd have to account for all those
    > old browsers somehow.


    It's only possible to discuss this in general terms since you have not
    provided any url so far.

    DU
    --
    Javascript and Browser bugs:
    http://www10.brinkster.com/doctorunclear/
    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
    http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
     
    DU, Sep 30, 2003
    #7
  8. shank

    b_imam77

    Joined:
    Dec 30, 2008
    Messages:
    1
    I am having same problem I want to align Center Horizontallly I am having Dhtml Menu which i want to center in table cell, but did not find any solution in css.
    At moment I am using <center> tag to align Menu to <center> But I want it in Css.

    thanks for your help in advance...

    Imam
     
    b_imam77, Dec 30, 2008
    #8
    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. Tom Bernsen

    Center Align Label and Hyperlink Control

    Tom Bernsen, Apr 22, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    17,853
    Ken Cox [Microsoft MVP]
    Apr 23, 2004
  3. tshad

    text-align vs align

    tshad, Jun 23, 2005, in forum: HTML
    Replies:
    1
    Views:
    1,266
    David Dorward
    Jun 23, 2005
  4. Paul Lautman

    left align within centre align

    Paul Lautman, Mar 3, 2006, in forum: HTML
    Replies:
    3
    Views:
    576
    Paul Lautman
    Mar 3, 2006
  5. Steve Richter
    Replies:
    1
    Views:
    903
    Mark Rae
    Jun 24, 2007
Loading...

Share This Page