For better browser compatibility, Microsoft recommends that
Web authors use one of the following methods.
Use the CENTER tag in HTML
To center a table by using the CENTER tag in HTML, the table must
be placed inside a set of <CENTER></CENTER> tags--for example:
<CENTER>
<TABLE WIDTH="90%">
<TR>
<TD>One</TD>
<TD>Two</TD>
<TD>Three</TD>
</TR>
</TABLE>
</CENTER>
Use the ALIGN attribute of the TABLE tag in HTML
To center a table by using the ALIGN attribute of the TABLE tag in
HTML, the opening tag for the table must have the ALIGN attribute added--for
example:
<TABLE WIDTH="90%" ALIGN="CENTER">
<TR>
<TD>One</TD>
<TD>Two</TD>
<TD>Three</TD>
</TR>
</TABLE>
Use cascading style sheets
To create a centered table by using cascading style sheets, a
table class must be used and both the left and the right margins must be equal.
To do this, both the left and the right margins must be set to "auto"--for
example:
<style>
table
{
margin-left: auto;
margin-right: auto;
}
</style>
This style will center all the tables on the page, when placed in
the <head> section of the HTML page.
Note Microsoft Internet Explorer 6.0 accommodates two settings per
page for strict and loose HTML compliance. By default all pages have loose
settings. Therefore, this style will be ignored. To force Internet Explorer to
follow strict HTML specifications and respect the table style, the following
doctype declaration must be placed outside the <HTML> tags of the page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
For more information about HTML formatting, visit the following World
Wide Web Consortium (W3C) Web site:
Microsoft
provides third-party contact information to help you find technical support.
This contact information may change without notice. Microsoft does not
guarantee the accuracy of this third-party contact information.