forked from terrill/AU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.html
executable file
·139 lines (133 loc) · 2.63 KB
/
table.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Table Exercise</title>
<style>
body {
margin: 0 1em;
font-family: Arial, Helvetica, sans-serif;
color: black;
background: white;
font-size: 1.1em;
line-height: 1.5em;
width: 75%;
}
h1 {
line-height: 1em;
}
.question {
border: thin solid #000000;
background-color: #ffc;
margin-bottom: 1em;
padding: 1em;
}
.accessible {
display: none;
}
.unreadable tr, .unreadable th, .unreadable td {
display: inline;
}
.unreadable table, .unreadable tr, .unreadable th, .unreadable td {
border: none;
font-weight: normal;
margin: 0;
padding: 0;
}
.readable table {
text-align: center;
border: 1px solid #000;
}
.readable th, .readable td {
border: 1px solid #000;
padding: 1em;
text-align: center;
}
.readable th {
font-weight: bold;
}
</style>
<script>
function swapTableStyle(style) {
var table = document.getElementsByTagName('table')[0];
var span = document.getElementById('adj');
if (table.getAttribute('class') == 'unreadable') {
table.setAttribute('class','readable');
document.getElementById('adj').innerHTML = 'more difficult to read';
}
else {
table.setAttribute('class','unreadable');
document.getElementById('adj').innerHTML = 'easier to read';
}
}
</script>
</head>
<body>
<h1>Table Exercise</h1>
<p class="question"><strong>Question 1.</strong> Based on the following IRS Tax Table, if you are single and earned $35 income in the last year, how much tax do you owe? </p>
<table class="unreadable">
<tr>
<th colspan="2">If your taxable income is</th>
<th colspan="4">And you are</th>
</tr>
<tr>
<th>At least</th>
<th>But less than</th>
<th>Single</th>
<th>Married filing jointly</th>
<th>Married filing separately</th>
<th>Head of household</th>
</tr>
<tr>
<td>0</td>
<td>5</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>5</td>
<td>15</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>15</td>
<td>25</td>
<td>2</td>
<td>2</td>
<td>2</td>
<td>2</td>
</tr>
<tr>
<td>25</td>
<td>50</td>
<td>4</td>
<td>4</td>
<td>4</td>
<td>4</td>
</tr>
<tr>
<td>50</td>
<td>75</td>
<td>6</td>
<td>6</td>
<td>6</td>
<td>6</td>
</tr>
<tr>
<td>75</td>
<td>100</td>
<td>9</td>
<td>9</td>
<td>9</td>
<td>9</td>
</tr>
</table>
</div>
<p><a href="#" onclick="swapTableStyle()">Make table <span id="adj">easier to read</span></a>.</p>
</body>
</html>