Alignment


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.




Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net