-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (95 loc) · 3.78 KB
/
index.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
<!doctype html>
<html>
<head>
<title>Responsive Tables</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
</head>
<body>
<h1>Responsive Tables</h1>
<p>by <a href="http://www.twitter.com/GregorTerrill">@GregorTerrill</a></p>
<a href="https://github.com/gregorterrill/ResponsiveTables"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<p>This jQuery script applies column headers to each sub-item at a pre-defined breakpoint, allowing more data to be displayed on mobile devices with a limited screen width.</p>
<p>This demo uses <a href="https://github.com/louisremi/jquery-smartresize/">debounced window resizing</a> by <a href="http://www.twitter.com/louis_remi/">@louis_remi</a> to decrease the frequency of resize events across different browsers.
<p>Each table that is to be made responsive requires the class name <em>responsiveTable</em>. Tables need to be properly scoped in order for the color swapping to function correctly.</p>
<p>The default breakpoint is 500px.</p>
<p>Resize the browser window to see the change occur.</p>
<table class="responsiveTable">
<caption>Number of Yearly Events Requiring Additional Funding</caption>
<thead>
<tr>
<td></td>
<th scope="col" id="C1">2008 - 09</th>
<th scope="col" id="C2">2009 - 10</th>
<th scope="col" id="C3">2010 - 11</th>
<th scope="col" id="C4">2011 - 12</th>
<th scope="col" id="C5">2012 - 13</th>
<th scope="col" id="C6">2013 - 14</th>
<th scope="col" id="C7">Total</th>
</tr>
</thead>
<tbody>
<tr>
<th colspan="8" scope="rowgroup" id="G1">Mandatory Yearly Events</td>
</tr>
<tr>
<th scope="row" id="R1">Resource Management Soirees in the Sub-Saharan Party Zone</th>
<td headers="C1 G1 R1">4</td>
<td headers="C2 G1 R1">6</td>
<td headers="C3 G1 R1">2</td>
<td headers="C4 G1 R1">8</td>
<td headers="C5 G1 R1">6</td>
<td headers="C6 G1 R1">7</td>
<td headers="C7 G1 R1">33</td>
</tr>
<tr>
<th scope="row" id="R2">Marginalized Animal Species Benefits for the Siberian Zoo</th>
<td headers="C1 G1 R2">2</td>
<td headers="C2 G1 R2">4</td>
<td headers="C3 G1 R2">6</td>
<td headers="C4 G1 R2">4</td>
<td headers="C5 G1 R2">2</td>
<td headers="C6 G1 R2">6</td>
<td headers="C7 G1 R2">24</td>
</tr>
<tr>
<th scope="row" id="R3">Gallery Openings for Underappreciated Fringe Artists</th>
<td headers="C1 G1 R3">1</td>
<td headers="C2 G1 R3">1</td>
<td headers="C3 G1 R3">6</td>
<td headers="C4 G1 R3">8</td>
<td headers="C5 G1 R3">6</td>
<td headers="C6 G1 R3">6</td>
<td headers="C7 G1 R3">28</td>
</tr>
<tr>
<th colspan="8" scope="rowgroup" id="G2">Unforeseen Dinners and Other Meals</td>
</tr>
<tr>
<th scope="row" id="R4">International Finger-Food Sampling Lunch Galas</th>
<td headers="C1 G2 R4">3</td>
<td headers="C2 G2 R4">5</td>
<td headers="C3 G2 R4">6</td>
<td headers="C4 G2 R4">2</td>
<td headers="C5 G2 R4">8</td>
<td headers="C6 G2 R4">2</td>
<td headers="C7 G2 R4">26</td>
</tr>
<tr>
<th scope="row" id="R5">NASCAR Barbeques for Visiting American Diplomats</th>
<td headers="C1 G2 R5">1</td>
<td headers="C2 G2 R5">2</td>
<td headers="C3 G2 R5">6</td>
<td headers="C4 G2 R5">4</td>
<td headers="C5 G2 R5">2</td>
<td headers="C6 G2 R5">1</td>
<td headers="C7 G2 R5">16</td>
</tr>
</tbody>
</table>
<br />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/debouncedresize.js"></script>
<script src="js/responsivetables.js"></script>
</body>
</html>