1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
3 <title>Table Border Models
</title>
4 <style type=
"text/css">
5 TABLE
{ margin: 1em; width: auto
; border: medium solid blue
; }
6 TD
{ border: thin solid green
; padding: 5px; }
7 TH
{ border: medium solid purple
; padding: 5px; }
8 TABLE
.one
, TABLE
.two
{ border-spacing: 1em; }
9 TABLE
.one
{ border-collapse: collapse
; }
10 TABLE
.two
{ border-collapse: separate
; }
11 TABLE
.three
{ border-collapse: separate
; border-spacing: 0 0.5em; }
12 TABLE
.four
{ border-collapse: separate
; border-spacing: 0.5em 0; }
13 TABLE
.five
{ border-collapse: separate
; }
14 TABLE
.five
, TABLE
.five TD
, TABLE
.five TH
, TABLE
.five CAPTION
{ border: none
; }
15 TABLE
.five TR
, TABLE
.five COL
, TABLE
.five COLGROUP
, TABLE
.five TBODY
, TABLE
.five THEAD
16 { border: medium solid red
; }
20 <h1>Table Border Models
</h1>
22 <p>This tests tests the
<a
23 href=
"http://www.w3.org/TR/REC-CSS2/tables.html#borders">CSS2 spec
24 rules on table borders
</a>. The styles applied here are:
</p>
27 TABLE { margin:
1em; border: medium solid blue; }
28 TD { border: thin solid green; padding:
5px; }
29 TH { border: medium solid purple; padding:
5px; }
30 TABLE.one, TABLE.two { border-spacing:
1em; }
31 TABLE.one { border-collapse: collapse; }
32 TABLE.two { border-collapse: separate; }
33 TABLE.three { border-collapse: separate; border-spacing:
0 0.5em; }
34 TABLE.four { border-collapse: separate; border-spacing:
0.5em
0; }
35 TABLE.five { border-collapse: separate; }
36 TABLE.five, TABLE.five TD, TABLE.five TH { border: none; }
37 TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD
38 { border: medium solid red; }
49 This table uses the collapsed borders model.
52 This means that elements within the cell have no border-spacing.
55 Since it has collapsed borders, the borders on the header cells,
56 on all sides, should be medium solid purple.
61 The border of the table itself should be medium solid blue, except
62 where header cells override the border.
65 The borders that I haven't already mentioned (all the other internal
66 ones) should be thin solid green.
69 This table should have a
1em margin around all edges. This margin
70 is measured from the
<em>middle
</em> of its border.
84 This table uses the separated borders model.
87 This means that elements within the cell have border-spacing of
1em.
90 The borders on the header cells,
91 on all sides, should be medium solid purple.
96 The border of the table itself should be medium solid blue.
99 The borders of other cells should be thin solid green.
102 This table should have a
1em margin around all edges. This margin
103 is measured from the
<em>outer edge
</em> of its border.
109 <table class=
"three">
113 <th>Header Three
</th>
117 This table uses the separated borders model.
120 Elements within the cell have horizontal border-spacing (i.e., width of
121 vertical lines) of
0 and vertical
122 border-spacing (i.e., height of horizontal lines) of
0.5em.
125 The borders on the header cells,
126 on all sides, should be medium solid purple.
131 The border of the table itself should be medium solid blue.
132 The borders of other cells should be thin solid green.
135 This table should have a
1em margin around all edges. This margin
136 is measured from the
<em>outer edge
</em> of its border.
139 The table should not be wider than the room available for it unless
140 that space is very small. Because of its margins, the width of the
141 table should be less than
100%.
151 <th>Header Three
</th>
155 This table uses the separated borders model.
158 Elements within the cell have horizontal border-spacing of
0.5em and vertical
162 The borders on the header cells,
163 on all sides, should be medium solid purple.
168 The border of the table itself should be medium solid blue.
169 The borders of other cells should be thin solid green.
172 This table should have a
1em margin around all edges. This margin
173 is measured from the
<em>outer edge
</em> of its border.
176 The table should not be wider than the room available for it unless
177 that space is very small. Because of its margins, the width of the
178 table should be less than
100%.
199 <th>Header Three
</th>
205 This table uses the separated borders model.
208 This means that borders are allowed only on table elements or table
212 They are not allowed on elements that represent rows,
213 row-groups, columns, or column-groups.
218 There should be no borders at all on this table!
221 If there are any borders shown that are not medium solid red, then
222 the problem is something other than what this test is testing.
225 This table should have a
1em margin around all edges. This margin
226 is measured from the
<em>outer edge
</em> of its border.