How to horizontally align a table with CSS?

Spread the love

To horizontally align a table with CSS, we set the margin properties.

For instance, we write

table {
  margin-left: auto;
  margin-right: auto;
}

to set the margin-left and margin-right properties to auto to horizontally align the table.

Leave a Reply

Your email address will not be published. Required fields are marked *