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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

selects the border styles at every cell edge.<br />

’background’<br />

The background properties set the background for cells in the column, but<br />

only if both the cell and row have transparent backgrounds. See "Table<br />

layers and transparency." [p. 254]<br />

’width’<br />

The ’width’ property gives the minimum width for the column.<br />

’visibility’<br />

If the ’visibility’ of a column is set to ’collapse’, none of the cells in the<br />

column are rendered, and cells that span into other columns are clipped. In<br />

addition, the width of the table is diminished by the width the column would<br />

have taken up. See "Dynamic effects" [p. 261] below. Other values for ’visibility’<br />

have no effect.<br />

Example(s):<br />

Here are some examples of style rules that set properties on columns. The first<br />

two rules together implement the "rules" attribute of HTML 4.0 with a value of<br />

"cols". The third rule makes the "totals" column blue, the final two rules shows<br />

how to make a column a fixed size, by using the fixed layout algorithm [p. 257] .<br />

COL { border-style: none solid }<br />

TABLE { border-style: hidden }<br />

COL.totals { background: blue }<br />

TABLE { table-layout: fixed }<br />

COL.totals { width: 5em }<br />

17.4 Tables in the visual formatting model<br />

In terms of the visual formatting model [p. 95] , a table may behave like a<br />

block-<strong>level</strong> [p. 97] or replaced inline-<strong>level</strong> [p. 98] element. Tables have content,<br />

padding, borders, and margins.<br />

In both cases, the table element generates an anonymous [p. 98] box that<br />

contains the table box itself and the caption’s box (if present). The table and<br />

caption boxes retain their own content, padding, margin, and border areas, and<br />

the dimensions of the rectangular anonymous box are the smallest required to<br />

contain both. Vertical margins collapse where the table box and caption box<br />

touch. Any repositioning of the table must move the entire anonymous box, not<br />

just the table box, so that the caption follows the table.<br />

250

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

Saved successfully!

Ooh no, something went wrong!