center tables with CSS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bastian

    center tables with CSS

    Hi,

    I have a problem with CSS. I read in other postings that it should be
    possible to center tables by

    TABLE {margin-left:auto; margin-right:auto}

    in an external stylesheet.
    But it doesn't work with IE 6.0 as it seems.
    I have to center my tables with

    <table align="center"> .

    Can anybody help me. Thanks.

    Bye

    Bastian
  • Els

    #2
    Re: center tables with CSS

    Bastian wrote:
    [color=blue]
    > I have a problem with CSS. I read in other postings that it should be
    > possible to center tables by
    >
    > TABLE {margin-left:auto; margin-right:auto}
    >
    > in an external stylesheet.
    > But it doesn't work with IE 6.0 as it seems.
    > I have to center my tables with
    >
    > <table align="center"> .[/color]

    Doesn't sound correct.
    Have you set a width on the table? Have you used a doctype?
    It should work in IE6.

    --
    Els
    Blog and other pages, mostly outdated.

    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -

    Comment

    • Steve Pugh

      #3
      Re: center tables with CSS

      darkburgundi@on linehome.de (Bastian) wrote:
      [color=blue]
      >I have a problem with CSS. I read in other postings that it should be
      >possible to center tables by
      >
      >TABLE {margin-left:auto; margin-right:auto}
      >
      >in an external stylesheet.
      >But it doesn't work with IE 6.0 as it seems.[/color]

      Are you triggering quirks or standards mode? If standards mode then
      this will work in IE6. If quirks mode then it won't.

      Steve

      --
      "My theories appal you, my heresies outrage you,
      I never answer letters and you don't like my tie." - The Doctor

      Steve Pugh <steve@pugh.net > <http://steve.pugh.net/>

      Comment

      • David Dorward

        #4
        Re: center tables with CSS

        Bastian wrote:
        [color=blue]
        > TABLE {margin-left:auto; margin-right:auto}
        > But it doesn't work with IE 6.0 as it seems.[/color]

        <http://dorward.me.uk/www/centre/#ie>

        --
        David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
        Home is where the ~/.bashrc is

        Comment

        Working...