center table

Discussion in 'HTML' started by earl, Nov 11, 2003.

  1. earl

    earl Guest

    <table width="640" cellpadding="0" cellspacing="0" id="mainTable">

    #mainTable
    {
    border : 1px;
    border-color: black;
    width: 640px;
    margin-left: auto;
    margin-right: auto;
    }

    The above code centers the table using opera 7.0 but not with IE 6.0. I like
    to do this using css and not html. Is there something Im missing ?
     
    earl, Nov 11, 2003
    #1
    1. Advertising

  2. earl

    Steve Pugh Guest

    "earl" <> wrote:

    ><table width="640" cellpadding="0" cellspacing="0" id="mainTable">
    >
    >#mainTable
    >{
    > border : 1px;
    > border-color: black;


    This would be better as
    border: 1pxs solid black;
    or
    border-width: 1px;
    border-style: solid;
    border-color: black;

    > width: 640px;
    > margin-left: auto;
    > margin-right: auto;
    >}
    >
    >The above code centers the table using opera 7.0 but not with IE 6.0. I like
    >to do this using css and not html. Is there something Im missing ?


    It will work in Win IE6 if you include a doctype that triggers
    standards mode rather than quirks mode. See
    http://www.hut.fi/~hsivonen/doctype.html

    It will not work in Win IE5.5 and lower.

    Steve

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

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Nov 11, 2003
    #2
    1. Advertising

  3. earl wrote:
    > margin-left: auto;
    > margin-right: auto;


    > The above code centers the table using opera 7.0 but not with IE 6.0. I
    > like to do this using css and not html. Is there something Im missing ?


    MSIE has more then a few bugs. Workarounds here:
    <http://dorward.me.uk/www/centre/#ie>

    --
    David Dorward http://dorward.me.uk/
     
    David Dorward, Nov 11, 2003
    #3
    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. ALI-R
    Replies:
    4
    Views:
    19,697
    ALI-R
    Feb 14, 2005
  2. Rabbit
    Replies:
    1
    Views:
    2,778
    Shimon Sim
    Feb 12, 2006
  3. ChChanges
    Replies:
    2
    Views:
    889
    Mitja
    Jun 16, 2004
  4. Anon
    Replies:
    2
    Views:
    968
    Jukka K. Korpela
    Mar 18, 2005
  5. richardv2
    Replies:
    3
    Views:
    447
    richardv2
    Jul 9, 2005
Loading...

Share This Page