Re: Should centering a table center the caption?

Marc-Etienne Vargenau wrote:
> Hello,
> 
> I need some expert advice on centering a table with CSS.
> 
> I know that I have to use
> margin-left:auto; margin-right: auto;
> to center the table with CSS.
> 
> With Opera, this centers the whole table, i.e. the cells and the caption.
> With Mozilla, this centers only the cells, not the caption.
> 
> Who is right?

Mozilla is right.

   | The table and caption boxes retain their own content,
   | padding, margin, and border areas, and the dimensions
   | of the rectangular anonymous box are the smallest
   | required to contain both.

   --- http://www.w3.org/TR/REC-CSS2/tables.html#q5

There's even a picture, if you're unsure.

Received on Tuesday, 17 December 2002 15:35:19 UTC