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 body
{ overflow: hidden
; }
6 TABLE
{ margin: 1em; width: auto
; border: medium solid blue
; }
7 TD
{ border: thin solid green
; padding: 5px; }
8 TH
{ border: medium solid purple
; padding: 5px; }
9 TABLE
.one
, TABLE
.two
{ border-spacing: 1em; }
10 TABLE
.one
{ border-collapse: collapse
; }
11 TABLE
.two
{ border-collapse: separate
; }
12 TABLE
.three
{ border-collapse: separate
; border-spacing: 0 0.5em; }
13 TABLE
.four
{ border-collapse: separate
; border-spacing: 0.5em 0; }
14 TABLE
.five
{ border-collapse: separate
; }
15 TABLE
.five
, TABLE
.five TD
, TABLE
.five TH
, TABLE
.five CAPTION
{ border: none
; }
16 TABLE
.five TR
, TABLE
.five COL
, TABLE
.five COLGROUP
, TABLE
.five TBODY
, TABLE
.five THEAD
17 { border: medium solid red
; }
21 <h1>Table Border Models
</h1>
23 <p>This tests tests the
<a
24 href=
"http://www.w3.org/TR/REC-CSS2/tables.html#borders">CSS2 spec
25 rules on table borders
</a>. The styles applied here are:
</p>
28 TABLE { margin:
1em; border: medium solid blue; }
29 TD { border: thin solid green; padding:
5px; }
30 TH { border: medium solid purple; padding:
5px; }
31 TABLE.one, TABLE.two { border-spacing:
1em; }
32 TABLE.one { border-collapse: collapse; }
33 TABLE.two { border-collapse: separate; }
34 TABLE.three { border-collapse: separate; border-spacing:
0 0.5em; }
35 TABLE.four { border-collapse: separate; border-spacing:
0.5em
0; }
36 TABLE.five { border-collapse: separate; }
37 TABLE.five, TABLE.five TD, TABLE.five TH { border: none; }
38 TABLE.five TR, TABLE.five COL, TABLE.five COLGROUP, TABLE.five TBODY, TABLE.five THEAD
39 { border: medium solid red; }
41 <div style=
"-webkit-writing-mode: vertical-rl;">
50 This table uses the collapsed borders model.
53 This means that elements within the cell have no border-spacing.
56 Since it has collapsed borders, the borders on the header cells,
57 on all sides, should be medium solid purple.
62 The border of the table itself should be medium solid blue, except
63 where header cells override the border.
66 The borders that I haven't already mentioned (all the other internal
67 ones) should be thin solid green.
70 This table should have a
1em margin around all edges. This margin
71 is measured from the
<em>middle
</em> of its border.
85 This table uses the separated borders model.
88 This means that elements within the cell have border-spacing of
1em.
91 The borders on the header cells,
92 on all sides, should be medium solid purple.
97 The border of the table itself should be medium solid blue.
100 The borders of other cells should be thin solid green.
103 This table should have a
1em margin around all edges. This margin
104 is measured from the
<em>outer edge
</em> of its border.
110 <table class=
"three">
114 <th>Header Three
</th>
118 This table uses the separated borders model.
121 Elements within the cell have horizontal border-spacing (i.e., width of
122 vertical lines) of
0 and vertical
123 border-spacing (i.e., height of horizontal lines) of
0.5em.
126 The borders on the header cells,
127 on all sides, should be medium solid purple.
132 The border of the table itself should be medium solid blue.
133 The borders of other cells should be thin solid green.
136 This table should have a
1em margin around all edges. This margin
137 is measured from the
<em>outer edge
</em> of its border.
140 The table should not be wider than the room available for it unless
141 that space is very small. Because of its margins, the width of the
142 table should be less than
100%.
152 <th>Header Three
</th>
156 This table uses the separated borders model.
159 Elements within the cell have horizontal border-spacing of
0.5em and vertical
163 The borders on the header cells,
164 on all sides, should be medium solid purple.
169 The border of the table itself should be medium solid blue.
170 The borders of other cells should be thin solid green.
173 This table should have a
1em margin around all edges. This margin
174 is measured from the
<em>outer edge
</em> of its border.
177 The table should not be wider than the room available for it unless
178 that space is very small. Because of its margins, the width of the
179 table should be less than
100%.
200 <th>Header Three
</th>
206 This table uses the separated borders model.
209 This means that borders are allowed only on table elements or table
213 They are not allowed on elements that represent rows,
214 row-groups, columns, or column-groups.
219 There should be no borders at all on this table!
222 If there are any borders shown that are not medium solid red, then
223 the problem is something other than what this test is testing.
226 This table should have a
1em margin around all edges. This margin
227 is measured from the
<em>outer edge
</em> of its border.