In normal paragraphs, text can be aligned on the left, right, or center, or can be justified, by setting the text-align property. Text in table cells can be aligned in the same way. See Chapter 7, "Space Inside Boxes," for the full definition of text-align. The content of cells can also be aligned vertically across rows because the contents of cells are not necessarily the same height, but the cells are. The vertical-align property, which otherwise determines the vertical position of words in a line, can also be applied to table cells to align the contents of cells in a row. Of the vertical-align property, only the values baseline, top, bottom, and middle apply to table cells. The initial value, baseline, ensures that the baseline of the first text line in a cell lines up with the first baseline of all other cells in the row that have their vertical-align property set to baseline. Figure 17.7 shows the four different alignments. Figure 17.7. The four vertical alignments applicable to table cells. From top to bottom: baseline, top, middle, and bottom.
|