Next / Previous / Contents / Shipman's homepage

12.3. Controlling alignment in tables

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:

Attribute values for deeper elements override those for shallower elements.

The value of the align attribute can be any of the following:

ValueMeaning
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:

The value of the align attribute can be any of these:

ValueMeaning
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.