Re: Centering tables

On Mon, 30 Sep 2002, Irene Vatton wrote:

> > I've noticed that when I put
> >
> > TABLE {
> >     margin-left: auto;
> >     margin-right: auto }
> >
> > in a CSS file, the tables do not get centered under Amaya, but they should
> > (and they do under IE and Netscape). Is this a bug or am I missing
> > something?
>
> Hum, CSS is not very clear about that.

I think that it is very clear about this. As you can read in Cascading
Style Sheets, level 2/CSS2 Specification/W3C Recommendation 12-May-1998
(at http://www.w3.org/TR/REC-CSS2/tables.html#q6):
--------------------------------------------------------------------------
The following example shows how to put a caption in the left margin. The
table itself is centered, by setting its left and right margins to 'auto',
and the whole box with table and caption is shifted into the left margin
by the same amount as the width of the caption.

BODY {
    margin-left: 8em
}
TABLE {
    margin-left: auto;
    margin-right: auto
}
---------------------------------------------------------------------------
> I checked that latest Mozilla and Opera versions do not center the table
> like Amaya.

I do not have Opera but I do have the latest version of Mozilla (1.2,
released the 10th September) and it does center the table, as it did the
version 1.0. Besides, the fact that other browsers don't so things as they
should does not justify the same behaviour from Amaya.

Best regards

Jose Carlos Santos

Received on Monday, 30 September 2002 09:50:33 UTC