Placing a Table in the Center of a Page


How do I center a table?

✍: FYIcenter


You place a table in the center of a page with the help of CSS as shown in this example:

In your HTML, use

<div class="center">

In your CSS, use {
    text-align: center;
} table {
    margin-left: auto;
    margin-right: auto;
    text-align: left;

2007-03-03, 5920👍, 0💬