Alignment

The beauty of XHTML tables is the precise control you have over the alignment of content in individual cells and over the table itself. You can specify two types of alignment:

  • Horizontal alignment— The alignment of an element across the width of something, such as the alignment of a header across the width of a cell or the alignment of a table across the width of the page. Horizontal alignment is controlled by the align attribute. You can set align equal to left, center, right, justify, or char (used to align with respect to a particular character).

  • Vertical alignment— The alignment of an element between the top and bottom of a cell. Vertical alignment of cell contents is controlled by setting the valign attribute to top, middle,

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.