467,171 Members | 1,253 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,171 developers. It's quick & easy.

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
Jul 20 '05 #1
  • viewed: 2736
Share:
3 Replies
Els
Bastian wrote:
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">.


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

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #2
da**********@onlinehome.de (Bastian) wrote:
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.


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
Bastian wrote:
TABLE {margin-left:auto; margin-right:auto}
But it doesn't work with IE 6.0 as it seems.


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

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Campbell's List | last post: by
6 posts views Thread by Bastian | last post: by
3 posts views Thread by scoffer | last post: by
14 posts views Thread by gaijinco | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.