Should centering a table center the caption?

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?

Expert advice with reference to CSS 2 document only please.

Test case below.

Regards,

Marc-Etienne Vargenau

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
 
<html>
  <head>
    <title>caption css center</title>
    <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<style type="text/css">
table {margin-left:auto; margin-right: auto; width:300px; border:solid green}
caption {width:300px; border:solid red}
</style>
  </head>

  <body>
    <table>
      <caption>
        caption
      </caption>

      <tr>
        <td>cell</td>

        <td>
        </td>
      </tr>
    </table>
  </body>
</html>


-- 
Marc-Etienne Vargenau http://vargenau.free.fr

Received on Tuesday, 17 December 2002 08:39:57 UTC