Perhaps someone more skilled with CSS than can help with this problem.
I am attempting to center a table (horizontally) relevant to the document width (i.e. the table appears in the middle of the page). I used the following CSS code
Code:
table.mymain {
display: block;
margin-left: auto;
margin-right: auto;
width: 100px;
}
The HTML is as follows:
HTML Code:
<table summary="" class="mymain" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr valign="top">
<td width="100%">
<p>[header]</p>
</td>
</tr>
<tr valign="top">
<td>
<p>[body]</p>
</td>
</tr>
<tr valign="top">
<td>
<p>[footer]</p>
</td>
</tr>
</tbody>
</table>
I'm using FireFox 3.5.9, mainly because I hate IE and refuse to install IE8, and the table does not appear to center to the page. It bears a left-align relevant to the page margins. So what have I done wrong?
|