table caption margin

Hi,

how would the following html align="center" attribute translate into css?

<html>
<body>
<table align="center" width="300">
<caption style="border:solid">
some caption text
</caption>
<tr><td>cell</td></tr>
</table>
</body>
</html>

For me the following two variants seem to be both valid ( to me ):
a)

<html>
<body>
<table width="300" style="margin-right:auto; margin-left:auto">
<caption style="border:solid; margin-right:auto; margin-left:auto">
the caption box would be 300px wide
</caption>
<tr><td>cell</td></tr>
</table>
</body>
</html>

b)

<html>
<body>
<table width="300" style="margin-right:auto; margin-left:auto">
<caption style="border:solid">
the caption box would as wide as the containing box -> span the whole body
</caption>
<tr><td>cell</td></tr>
</table>
</body>
</html>

One of them is probably wrong, but why?

Thanks for your help

Bernd

Received on Monday, 11 June 2001 07:12:28 UTC