In this tutorial on “how to align HTML table”, we will teach you to align a table in HTML to the right, left and center of the page. A table in HTML can be aligned using the align attribute inside a table tag. The align attribute is deprecated in HTML 4.0 and is not supported by HTML 5. Tables can be aligned to right, left and center using the align-right, align-left and align-center table’s property respectively. Text in the tables aligns top in HTML and can also be aligned to left, right and bottom.
Step 1: Align HTML Table to right
A table in HTML can be aligned to the right side of the web page using the table’s property align-right. In order to align HTML table, add the align-right property in the table tag. This will align the table to the right side of the web page. By default table aligns top in HTML.
Step 2: Align HTML Table to left
A table in HTML can be aligned to the left side of the web page using the table’s property align-left. In order to align the table, add the align-left property in the table tag. This will align the table to the left side of the web page.
Step 3: Align HTML Table to center
A table in HTML can be aligned to the center side of the web page using the table’s property align- center. In order to align the table, add the align- center property in the table tag. This will align the table to the center side of the web page.