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.

An example of a table with collapsed borders.<br />

Example(s):<br />

The next example shows a table with horizontal rules between the rows. The<br />

top border of the table is set to ’hidden’ to suppress the top border of the first<br />

row. This implements the "rules" attribute of HTML 4.0 (rules="rows").<br />

TABLE[rules=rows] TR { border-top: solid }<br />

TABLE[rules=rows] { border-collapse: collapse;<br />

border-top: hidden }<br />

a b c<br />

3 4 5<br />

5 12 13<br />

Table with horizontal rules between the rows.<br />

In this case the same effect can also be achieved without setting a ’hidden’<br />

border on TABLE, by addressing the first row separately. Which method is<br />

preferred is a matter of taste.<br />

TR:first-child { border-top: none }<br />

TR { border-top: solid }<br />

Example(s):<br />

Here is another example of hidden collapsing borders:<br />

Table with two omitted internal borders.<br />

HTML source:<br />

<br />

foo<br />

bar<br />

foo<br />

bar<br />

<br />

17.6.3 Border styles<br />

Some of the values of the ’border-style’ have different meanings in tables than for<br />

other elements. In the list below they are marked with an asterisk.<br />

none<br />

No border.<br />

*hidden<br />

Same as ’none’, but in the collapsing border model [p. 263] , also inhibits<br />

any other border (see the section on border conflicts [p. 264] ).<br />

dotted<br />

The border is a series of dots.<br />

dashed<br />

The border is a series of short line segments.<br />

266

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

Saved successfully!

Ooh no, something went wrong!