22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

far. (See conditions on the cell padding below.)<br />

3. If any of the remaining cells, those aligned at the bottom or the middle, have<br />

a height that is larger than the current height of the row, the height of the row<br />

will be increased to the maximum of those cells, by lowering the bottom.<br />

4. Finally the remaining cells are positioned.<br />

Cell boxes that are smaller than the height of the row receive extra top or<br />

bottom padding.<br />

17.5.4 Horizontal alignment in a column<br />

The horizontal alignment of a cell’s content within a cell box is specified with the<br />

’text-align’ property.<br />

When the ’text-align’ property for more than one cell in a column is set to a<br />

value, the content of those cells is aligned along a vertical axis. The<br />

beginning of the string touches this axis. Character directionality determines<br />

whether the string lies to the left or right of the axis.<br />

Aligning text in this way is only useful if the text fits on one line. The result is<br />

undefined if the cell content spans more than one line.<br />

If value of ’text-align’ for a table cell is a string but the string doesn’t occur in<br />

the cell content, the end of the cell’s content touches the vertical axis of alignment.<br />

Note that the strings do not have to be the same for each cell, although they<br />

usually are.<br />

CSS does not provide a way specify the offset of the vertical alignment axis<br />

with respect to the edge of a column box.<br />

Example(s):<br />

The following style sheet:<br />

TD { text-align: "." }<br />

TD:before { content: "$" }<br />

will cause the column of dollar figures in the following HTML table:<br />

<br />

<br />

Long distance calls<br />

1.30<br />

2.50<br />

10.80<br />

111.01<br />

85.<br />

90<br />

.05<br />

.06<br />

<br />

to align along the decimal point. For fun, we have used the :before<br />

pseudo-element to insert a dollar sign before each figure. The table might be<br />

rendered as follows:<br />

260

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!