center table

E

earl

<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 ?
 
S

Steve Pugh

earl said:
<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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top