-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtables.html
275 lines (269 loc) · 7.93 KB
/
tables.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Tables Bookmarklet for Accessibility Testing</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
</head>
<body>
<p><a href="index.html"><span aria-hidden="true"><</span> Back to Bookmarklets for Accessibility Testing</a></p>
<h1>Tables Bookmarklet for Accessibility Testing</h1>
<p>Tables Bookmarklet for Accessibility Testing inserts data table tags and attributes into the DOM with a yellow highlighted background so you can quickly identify the accessibility errors. <th> cells show a ♿wheelchair symbol emoji. <caption> tags show a🎓graduation cap emoji. Scope attributes show a 👇 white down pointing backhand index emoji for scope="col" and 🚣 rowboat emoji for scope="row". Headers and summary attributes show a ♿wheelchair symbol emoji. If an ID Reference to a non-existent ID exist then a red x emoji error shows ❌NO ID MATCH. <table> tags are outlined in Olive, <th> are outlined in green, <td> tags have a orange dashed outline. Missing ID reference error cells have a red dotted outline. </p>
<h2>Installation</h2>
<p><a href="javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/tables.js';var iframes=document.getElementsByTagName('iframe');for(i=0;i<iframes.length;i++) {iframes[i].contentDocument.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/tables.js';}})();">Tables Bookmarklet</a> (drag link to bookmarks bar)</p>
<h2>Test Content</h2>
<table>
<tr>
<td> </td>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
</tr>
<tr>
<th>8:00-9:00</th>
<td>Meet with Sam</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th>9:00-10:00</th>
<td> </td>
<td> </td>
<td>Doctor Williams</td>
<td>Sam again</td>
<td>Leave for San Antonio</td>
</tr>
</table>
<table border="1">
<caption>Contact Information</caption>
<tr>
<td></td>
<th scope="col">Name</th>
<th scope="col">Phone#</th>
<th scope="col">Fax#</th>
<th scope="col">City</th>
</tr><tr>
<td>1.</td>
<th scope="row">Joel Garner</th>
<td>412-212-5421</td>
<td>412-212-5400</td>
<td>Pittsburgh</td>
</tr><tr>
<td>2.</td>
<th scope="row">Clive Lloyd</th>
<td>410-306-1420</td>
<td>410-306-5400</td>
<td>Baltimore</td>
</tr><tr>
<td>3.</td>
<th scope="row">Gordon Greenidge</th>
<td>281-564-6720</td>
<td>281-511-6600</td>
<td>Houston</td>
</tr>
</table>
<table summary="Schedule for Route 7 going downtown. Service begins
at 4:00 AM and ends at midnight. Intersections are listed in the top row.
Find the intersection closest to your starting point or destination, then read
down that column to find out what time the bus leaves that intersection.">
<tr>
<th scope="col">State & First</th>
<th scope="col">State & Sixth</th>
<th scope="col">State & Fifteenth</th>
<th scope="col">Fifteenth & Morrison</th>
</tr>
<tr>
<td>4:00</td>
<td>4:05</td>
<td>4:11</td>
<td>4:19</td>
</tr>
…
</table>
<table summary="layout table">
<tr>
<th colspan=3>Page Title</th>
</tr>
<tr>
<td><div>navigation content</div></td>
<td><div>main content</div></td>
<td><div>right sidebar content</div></td>
</tr>
<tr>
<td colspan=3>footer</td>
</tr>
</table>
<table>
<tr>
<th rowspan="2" id="h">Homework</th>
<th colspan="3" id="e">Exams</th>
<th colspan="3" >Projects</th>
</tr>
<tr>
<th id="e1" headers="e">1</th>
<th id="e2" headers="e">2</th>
<th id="ef" headers="e">Final</th>
<th id="p1" headers="p">1</th>
<th id="p2" headers="p">2</th>
<th id="pf" headers="p">Final</th>
</tr>
<tr>
<td headers="h">15%</td>
<td headers="e p1">15%</td>
<td headers="e p2">15%</td>
<td headers="e pf">20%</td>
<td headers="e e1">10%</td>
<td headers="e e2">10%</td>
<td headers="non-existent-id ef">15%</td>
</tr>
</table>
<h2 id="calburn">Calorie burn by pace and weight</h2>
<div role="grid"
aria-labelledby="calburn"
aria-readonly="true">
<table role="presentation">
<tr role="row">
<th role="columnheader">Pace</th>
<th role="columnheader">59KG</th>
<th role="columnheader">74KG</th>
<th role="columnheader">86KG</th>
</tr>
</table>
<table role="presentation">
⋯
<tr role="row">
<th role="rowheader">12 min/mile</th>
<td role="gridcell">472 cal/hour</td>
<td role="gridcell">582 cal/hour</td>
<td role="gridcell">691 cal/hour</td>
</tr>
<tr role="row">
<th role="rowheader">11 min/mile</th>
<td role="gridcell">532 cal/hour</td>
<td role="gridcell">655 cal/hour</td>
<td role="gridcell">734 cal/hour</td>
</tr>
<tr role="row">
<th role="rowheader">10 min/mile</th>
<td role="gridcell">591 cal/hour</td>
<td role="gridcell">727 cal/hour</td>
<td role="gridcell">864 cal/hour</td>
</tr>
⋯
</table>
</div>
<table role="presentation">
<tbody><tr>
<td>see presentation</td>
<td>spot</td>
<td>run</td>
</tr>
<tr>
<td>over</td>
<td>the</td>
<td>lazy coder</td>
</tr>
</tbody></table>
<h3>Visually Hidden Caption Test</h3>
<style>
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap;
}
</style>
<table>
<caption class="visuallyhidden">Employee directory</caption>
<thead>
<tr>
<th scope="col">First Name</th>
<th scope="col">Last Name</th>
<th scope="col">Phone Number</th>
<th scope="col">Birth Date</th>
<th scope="col">Sex</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alan</td>
<td>Turing</td>
<td>(111) 111-1111</td>
<td>1912-06-23</td>
<td>Male</td>
</tr>
<tr>
<td>Grace</td>
<td>Hopper</td>
<td>(202) 222-2222</td>
<td>1906-12-09</td>
<td>Female</td>
</tr>
<tr>
<td>Blaise</td>
<td>Pascal</td>
<td>(333) 333-3333</td>
<td>1623-06-19</td>
<td>Male</td>
</tr>
<tr>
<td>Dennis</td>
<td>Richie</td>
<td>(404) 159-7563</td>
<td>1941-09-09</td>
<td>Male</td>
</tr>
</tbody>
</table>
<br><br>
<table aria-label="Monthly savings aria-label text">
<tr>
<th>Month</th>
<th>Savings aria-label test</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<h3 id="h3label">Monthly savings aria-labelledby test</h3>
<table aria-labelledby="h3label">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<h2>Bookmarklet Demo
<script type="application/javascript">
function loadJS(file) {
// DOM: Create the script element
var jsElm = document.createElement("script");
// set the type attribute
jsElm.type = "application/javascript";
// make the script element load file
jsElm.src = file;
// finally insert the element to the body element in order to load the script
document.body.appendChild(jsElm);
}
</script>
</h2>
<button onclick="loadJS('tables.js');">Show Tables Info</button>
<h4><a href="iosinstall.html">Not so easy installation method</a></h4>
<label for="jscode">Copy/Paste JavaScript Bookmarklet URL Code</label><br>
<textarea id="jscode" rows="4" cols="40">javascript:(function(){document.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/tables.js';var iframes=document.getElementsByTagName('iframe');for(i=0;i<iframes.length;i++) {iframes[i].contentDocument.body.appendChild(document.createElement('script')).src='https://cdn.jsdelivr.net/gh/pauljadam/bookmarklets@master/tables.js';}})();</textarea>
</body>
</html>