-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathtable-as-data-graphics.html
155 lines (155 loc) · 5.69 KB
/
table-as-data-graphics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Graphical Tables</title>
<link rel="stylesheet" href="css/normalization.css" />
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/table.css" />
</head>
<body>
<div class="container">
<div class="page-wrapper">
<h1>Creating a Table for Graphical Representation</h1>
<p><a href="http://haltersweb.github.io/Accessibility/">View the library of solutions.</a></p>
<h2>The Problem</h2>
<p>How to tie the <thead> contents to the tbody cells when the <thead> is hidden and <thead> content has been moved to <tfoot>.</p>
<h3>What didn't work</h3>
<ul class="bullet singletons">
<li>Hiding the <thead> with .screen-reader-text</li>
<li>Using <tfoot> contents by themselves. <tfoot> content doesn't map to cells it relates to.</li>
<li>Giving <thead> a display: table-footer-group</li>
<li>Using position: absolute and moving <thead> the bottom (if it stays at the top it's OK)</li>
<li>Giving <tfoot> a display: table-header-group</li>
<li>Assigning <thead> position: relative and top. Works for FF, doesn't reposition in Safari.</li>
</ul>
<h3>What does work: K.I.S.S.</h3>
<ul class="bullet singletons">
<li>Don't try to hide the <thead> with .screen-reader-text.</li>
<li>Write special style for <thead> th with height: 1px, etc.</li>
<li>Don't use <tfoot> at all.</li>
<li>Create a div to hold a copy of the <thead> content at the bottom of the table.</li>
</ul>
<h2>How screen readers handle <thead></h2>
<p>When focus is given to the <th> cells in the <thead>:</p>
<ul class="bullet singletons">
<li><strong>IE/JAWS:</strong> identifies cell content correctly with no superfluous identification. (correct)</li>
<li><strong>FF/NVDA:</strong> identifies cell content correctly with no superfluous identification. (correct)</li>
<li><strong>Safari/VO:</strong> content in cells 2+ are identified using cell 1 content (incorrect)</li>
</ul>
<h2>How screen readers handle <tfoot></h2>
<p><tfoot> is not supported as a table heading set in any screen reader. It is simply treated as a final row of data. (See <tbody> below.)</p>
<h2>How screen readers handle <tbody></h2>
<h3>Row <th> tags:</h3>
<ul class="bullet singletons">
<li><strong>IE/JAWS:</strong> identifies cell content correctly with no superfluous identification. (correct)</li>
<li><strong>FF/NVDA:</strong> identifies cell content correctly with no superfluous identification. (correct)</li>
<li><strong>Safari:</strong> identifies the cell with all <th> content above it the when reviewing via row cells. (incorrect)</li>
</ul>
<h3><td> tags:</h3>
<p>Depending on whether you enter a <td> from the top/bottom or from the left/right it will be identified either by the th[scope="row"] or th[scope="col"] content.</p>
<p>No screen readers yet correctly identify a <td> with both corresponding <th>s at the same time.</p>
<h2>Table Examples</h2>
<h3>Normal table with <thead>, left <th> cells, and <tfoot>.</h3>
<div class="table-wrap">
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Birthday</th>
<th scope="col">Company</th>
<th scope="col">Automobile</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col">First Name</th>
<th scope="col">Day and Month</th>
<th scope="col">Workplace</th>
<th scope="col">Manufacturer</th>
</tr>
</tfoot>
<tbody>
<tr>
<th scope="row">Adina</th>
<td>May 19</td>
<td>Comcast</td>
<td>Highlander</td>
</tr>
<tr>
<th scope="row">George</th>
<td>December 12</td>
<td>Vanguard</td>
<td>Sienna</td>
</tr>
<tr>
<th scope="row">Jonathan</th>
<td>July 11</td>
<td>Harriton</td>
<td>none</td>
</tr>
<tr>
<th scope="row">Lydia</th>
<td>December 8</td>
<td>Welsh Valley</td>
<td>none</td>
</tr>
</tbody>
</table>
</div>
<h3>Table cell with "hidden" <thead> and fake <tfoot> for use in a graphical data chart.</h3>
<div class="table-wrap graphic-table">
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Birthday</th>
<th scope="col">Company</th>
<th scope="col">Automobile</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Adina</th>
<td>May 19</td>
<td>Comcast</td>
<td>Highlander</td>
</tr>
<tr>
<th scope="row">George</th>
<td>December 12</td>
<td>Vanguard</td>
<td>Sienna</td>
</tr>
<tr>
<th scope="row">Jonathan</th>
<td>July 11</td>
<td>Harriton</td>
<td>none</td>
</tr>
<tr>
<th scope="row">Lydia</th>
<td>December 8</td>
<td>Welsh Valley</td>
<td>none</td>
</tr>
</tbody>
</table>
<div class="tfoot" aria-hidden="true">
<div>Name</div>
<div>Bithday</div>
<div>Company</div>
<div>Automobile</div>
</div>
</div>
<p>Ths is <a href="#">a fake link</a>.</p>
</div>
<div class="overlay"></div>
<div class="block-screen"></div>
</div>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/namespacing.js"></script>
<script type="text/javascript" src="js/accessibility-helpers.js"></script>
</body>
</html>