Horizontal alignment
The align attribute accepts
the usual values left, right, center, and justify. Text is left-justified by default
in left-to-right reading languages.
The align attribute also
includes the char value that
specifies that the table contents should be aligned on a specific
character, such as a decimal point for a column of currency amounts.
The character used for alignment is provided by the char attribute. The charoff attribute specifies the offset
distance to the first alignment character. Although it’s a nifty idea,
the char and charoff attributes are not supported by
current browsers.
Alignment settings for individual cells (td or th)
always override settings at the higher levels. Alignment set on
elements within a cell (a p
element, for example) override the cell’s alignment. If the table
includes a col or colgroup, the align settings on the columns override any
alignment applied to a row or row group element.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access