Center aligning a table within DIV element

Define the CSS style in css file or header of the HTML page: {
text-align: center;
} table {
margin-left: auto;
margin-right: auto;
text-align: left;

Here is the HTML (within BODY tag):

<div class="center">
<table><tr><td>Content in center aligned table</td></tr></table>

Leave a Reply

Your email address will not be published.