With HTML 4, you could center a table using
align="center"
.
<table align="center">
...
</table>
However, that method of centering a table is deprecated in
HTML5.
To center a table, which is a block-level element, in HTML5 using
a Cascading Style Sheets method, you can use
a style that includes margin-left: auto; margin-right: auto;
as shown below.
<table style="margin-left: auto; margin-right: auto;">
...
</table>
[ More Info ]