MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
September
Sun Mon Tue Wed Thu Fri Sat
       
28  
2016
Months
Sep


Wed, Sep 28, 2016 10:55 pm

Centering a table with CSS

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 ]

[/network/web/html/css] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo