By alignment, we mean the positioning of elements within the cells of a table. Since most cells will not be filled exactly, we need ways of controlling where the content is placed within the cell, both horizontally and vertically.
Horizontal alignment is controlled by the align attribute. This attribute can be used:
in a tgroup element, to set the
default alignment for the table as a whole;
in a colspec element, to set the
default alignment for one column; or
in an entry element, to set the
alignment for a specific cell.
Attribute values for deeper elements override those for shallower elements.
The value of the align attribute can be
any of the following:
| Value | Meaning |
|---|---|
left
| Content is aligned to the left side of each cell. |
right
| Content is aligned to the right side. |
center
| Content is centered. |
justify
| Text is shown as a justified paragraph, stretched to the full width of the cell. |
Vertical alignment is controlled by the valign attribute. This attribute can be used:
in a row element, to set the default
alignment for that row; or
in an entry element, to change the
alignment of a single cell.
The value of the attribute can be any of these:
valign
| Value | Meaning |
|---|---|
top
| Content is aligned to the top side of each cell. |
middle
| Content is centered vertically in the cell. |
bottom
| Content is aligned to the bottom of the cell. |