I have an HTML table with large number of rows, and I need to right align one column.
I know the following ways,
..
-
The
and
tags that lives inside tables are designed for this purpose. If you have three columns in your table and want to align the third, add this after your opening tag:
along with the requisite CSS:
.your-right-align-class { text-align: right; }
From the W3:
Definition and Usage
The
tag defines attribute values for one or more columns in a table.
The
tag is useful for applying styles to entire columns, instead of repeating the styles for each cell, for each row.
- 热议问题