Mercurial > nebulaweb3
comparison default/node_modules/tablesaw/demo/toggle.html @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
1 <!doctype html> | |
2 <html lang="en"> | |
3 <head> | |
4 <meta charset="utf-8"> | |
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
6 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
7 <title>TableSaw Column Toggle Table</title> | |
8 | |
9 <link rel="stylesheet" href="../dist/tablesaw.css"> | |
10 <link rel="stylesheet" href="demo.css"> | |
11 <link rel="stylesheet" href="//filamentgroup.github.io/demo-head/demohead.css"> | |
12 | |
13 <script> | |
14 TablesawConfig = { | |
15 getColumnToggleLabelTemplate: function( text ) { | |
16 return "<label><input type='checkbox' checked><span>" + text + "</span></label>"; | |
17 } | |
18 }; | |
19 </script> | |
20 <script src="../dist/tablesaw.js"></script> | |
21 <script src="../dist/tablesaw-init.js"></script> | |
22 <script src="//filamentgroup.github.io/demo-head/loadfont.js"></script> | |
23 </head> | |
24 <body> | |
25 <div class="demo-header"> | |
26 <div class="company"> | |
27 <img src="http://filamentgroup.com/images/fg-logo-positive-sm-crop.png"> | |
28 </div> | |
29 <div class="details"> | |
30 <h1 class="description-container">Demo of <span class="repo-name">Tablesaw</span> | |
31 <span class="description">A group of plugins for responsive tables.</span> | |
32 </h1> | |
33 <ul class="outbound-links"> | |
34 <li><a href="https://github.com/filamentgroup/tablesaw">Code</a></li> | |
35 <li><a href="https://github.com/filamentgroup/tablesaw/issues">Issues</a></li> | |
36 </ul> | |
37 </div> | |
38 </div> | |
39 <div class="nav-container"> | |
40 <div class="docs-globalnav"> | |
41 <nav class="docs-nav"> | |
42 <a href="kitchensink.html">Kitchen Sink</a> | |
43 <a href="modeswitch.html">Mode Switch</a> | |
44 <a href="sort.html">Sortable</a> | |
45 <a href="stack.html">Stack</a> | |
46 <a href="stackonly.html">Stack Only</a> | |
47 <a href="swipe.html">Swipe Table</a> | |
48 <a href="toggle.html" class="current">Toggle</a> | |
49 <a href="checkall.html">Check All</a> | |
50 </nav> | |
51 </div> | |
52 </div> | |
53 <div class="docs-main"> | |
54 | |
55 <h2>Column Toggle Table</h2> | |
56 <p>The Column Toggle Table allows the user to select which columns they want to be visible.</p> | |
57 <table class="tablesaw" data-tablesaw-mode="columntoggle"> | |
58 <thead> | |
59 <tr> | |
60 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title</th> | |
61 <th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank</th> | |
62 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year</th> | |
63 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="0" colspan="2">Gross</th> | |
64 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1"><abbr title="Rotten Tomato Rating">Rating</abbr></th> | |
65 </tr> | |
66 </thead> | |
67 <tbody> | |
68 <tr> | |
69 <td class="title"><a href="http://en.wikipedia.org/wiki/Avatar_(2009_film)">Avatar</a></td> | |
70 <td>1</td> | |
71 <td rowspan="2">2009</td> | |
72 <td>$2.7B</td> | |
73 <td>$2.7B</td> | |
74 <td>83%</td> | |
75 </tr> | |
76 <tr> | |
77 <td class="title"><a href="http://en.wikipedia.org/wiki/Titanic_(1997_film)">Titanic</a></td> | |
78 <td>2</td> | |
79 <td>$2.1B</td> | |
80 <td>$2.1B</td> | |
81 <td>88%</td> | |
82 </tr> | |
83 <tr> | |
84 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Avengers_(2012_film)">The Avengers</a></td> | |
85 <td>3</td> | |
86 <td>2012</td> | |
87 <td>$1.5B</td> | |
88 <td>$1.5B</td> | |
89 <td>92%</td> | |
90 </tr> | |
91 <tr> | |
92 <td class="title"><a href="http://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_2">Harry Potter and the Deathly Hallows—Part 2</a></td> | |
93 <td>4</td> | |
94 <td>2011</td> | |
95 <td>$1.3B</td> | |
96 <td>$1.3B</td> | |
97 <td>96%</td> | |
98 </tr> | |
99 <tr> | |
100 <td class="title"><a href="http://en.wikipedia.org/wiki/Frozen_(2013_film)">Frozen</a></td> | |
101 <td>5</td> | |
102 <td>2013</td> | |
103 <td>$1.2B</td> | |
104 <td>$1.2B</td> | |
105 <td>89%</td> | |
106 </tr> | |
107 <tr> | |
108 <td class="title"><a href="http://en.wikipedia.org/wiki/Iron_Man_3">Iron Man 3</a></td> | |
109 <td>6</td> | |
110 <td>2013</td> | |
111 <td>$1.2B</td> | |
112 <td>$1.2B</td> | |
113 <td>78%</td> | |
114 </tr> | |
115 <tr> | |
116 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Dark_of_the_Moon">Transformers: Dark of the Moon</a></td> | |
117 <td>7</td> | |
118 <td>2011</td> | |
119 <td>$1.1B</td> | |
120 <td>$1.1B</td> | |
121 <td>36%</td> | |
122 </tr> | |
123 <tr> | |
124 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Lord_of_the_Rings:_The_Return_of_the_King">The Lord of the Rings: The Return of the King</a></td> | |
125 <td>8</td> | |
126 <td>2003</td> | |
127 <td>$1.1B</td> | |
128 <td>$1.1B</td> | |
129 <td>95%</td> | |
130 </tr> | |
131 <tr> | |
132 <td class="title"><a href="http://en.wikipedia.org/wiki/Skyfall">Skyfall</a></td> | |
133 <td>9</td> | |
134 <td>2012</td> | |
135 <td>$1.1B</td> | |
136 <td>$1.1B</td> | |
137 <td>92%</td> | |
138 </tr> | |
139 <tr> | |
140 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Age_of_Extinction">Transformers: Age of Extinction</a></td> | |
141 <td>10</td> | |
142 <td>2014</td> | |
143 <td>$1.0B</td> | |
144 <td>$1.0B</td> | |
145 <td>18%</td> | |
146 </tr> | |
147 </tbody> | |
148 </table> | |
149 | |
150 <p>Add a <code><div class="tablesaw-overflow"></code> wrapper element to enable overflow scrolling when too many columns are selected by the user.</p> | |
151 <div class="tablesaw-overflow"> | |
152 <table class="tablesaw" data-tablesaw-mode="columntoggle"> | |
153 <thead> | |
154 <tr> | |
155 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title</th> | |
156 <th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank</th> | |
157 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year</th> | |
158 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="0" colspan="2">Gross</th> | |
159 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1"><abbr title="Rotten Tomato Rating">Rating</abbr></th> | |
160 </tr> | |
161 </thead> | |
162 <tbody> | |
163 <tr> | |
164 <td class="title"><a href="http://en.wikipedia.org/wiki/Avatar_(2009_film)">Avatar</a></td> | |
165 <td>1</td> | |
166 <td rowspan="2">2009</td> | |
167 <td>$2.7B</td> | |
168 <td>$2.7B</td> | |
169 <td>83%</td> | |
170 </tr> | |
171 <tr> | |
172 <td class="title"><a href="http://en.wikipedia.org/wiki/Titanic_(1997_film)">Titanic</a></td> | |
173 <td>2</td> | |
174 <td>$2.1B</td> | |
175 <td>$2.1B</td> | |
176 <td>88%</td> | |
177 </tr> | |
178 <tr> | |
179 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Avengers_(2012_film)">The Avengers</a></td> | |
180 <td>3</td> | |
181 <td>2012</td> | |
182 <td>$1.5B</td> | |
183 <td>$1.5B</td> | |
184 <td>92%</td> | |
185 </tr> | |
186 <tr> | |
187 <td class="title"><a href="http://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_2">Harry Potter and the Deathly Hallows—Part 2</a></td> | |
188 <td>4</td> | |
189 <td>2011</td> | |
190 <td>$1.3B</td> | |
191 <td>$1.3B</td> | |
192 <td>96%</td> | |
193 </tr> | |
194 <tr> | |
195 <td class="title"><a href="http://en.wikipedia.org/wiki/Frozen_(2013_film)">Frozen</a></td> | |
196 <td>5</td> | |
197 <td>2013</td> | |
198 <td>$1.2B</td> | |
199 <td>$1.2B</td> | |
200 <td>89%</td> | |
201 </tr> | |
202 <tr> | |
203 <td class="title"><a href="http://en.wikipedia.org/wiki/Iron_Man_3">Iron Man 3</a></td> | |
204 <td>6</td> | |
205 <td>2013</td> | |
206 <td>$1.2B</td> | |
207 <td>$1.2B</td> | |
208 <td>78%</td> | |
209 </tr> | |
210 <tr> | |
211 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Dark_of_the_Moon">Transformers: Dark of the Moon</a></td> | |
212 <td>7</td> | |
213 <td>2011</td> | |
214 <td>$1.1B</td> | |
215 <td>$1.1B</td> | |
216 <td>36%</td> | |
217 </tr> | |
218 <tr> | |
219 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Lord_of_the_Rings:_The_Return_of_the_King">The Lord of the Rings: The Return of the King</a></td> | |
220 <td>8</td> | |
221 <td>2003</td> | |
222 <td>$1.1B</td> | |
223 <td>$1.1B</td> | |
224 <td>95%</td> | |
225 </tr> | |
226 <tr> | |
227 <td class="title"><a href="http://en.wikipedia.org/wiki/Skyfall">Skyfall</a></td> | |
228 <td>9</td> | |
229 <td>2012</td> | |
230 <td>$1.1B</td> | |
231 <td>$1.1B</td> | |
232 <td>92%</td> | |
233 </tr> | |
234 <tr> | |
235 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Age_of_Extinction">Transformers: Age of Extinction</a></td> | |
236 <td>10</td> | |
237 <td>2014</td> | |
238 <td>$1.0B</td> | |
239 <td>$1.0B</td> | |
240 <td>18%</td> | |
241 </tr> | |
242 </tbody> | |
243 </table> | |
244 </div> | |
245 | |
246 <h2>Column Toggle Table with Mini Map</h2> | |
247 | |
248 <div class="tablesaw-overflow"> | |
249 <table class="tablesaw" data-tablesaw-mode="columntoggle" data-tablesaw-minimap> | |
250 <thead> | |
251 <tr> | |
252 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title</th> | |
253 <th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank</th> | |
254 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year</th> | |
255 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1"><abbr title="Rotten Tomato Rating">Rating</abbr></th> | |
256 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4">Gross</th> | |
257 </tr> | |
258 </thead> | |
259 <tbody> | |
260 <tr> | |
261 <td class="title"><a href="http://en.wikipedia.org/wiki/Avatar_(2009_film)">Avatar</a></td> | |
262 <td>1</td> | |
263 <td>2009</td> | |
264 <td>83%</td> | |
265 <td>$2.7B</td> | |
266 </tr> | |
267 <tr> | |
268 <td class="title"><a href="http://en.wikipedia.org/wiki/Titanic_(1997_film)">Titanic</a></td> | |
269 <td>2</td> | |
270 <td>1997</td> | |
271 <td>88%</td> | |
272 <td>$2.1B</td> | |
273 </tr> | |
274 <tr> | |
275 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Avengers_(2012_film)">The Avengers</a></td> | |
276 <td>3</td> | |
277 <td>2012</td> | |
278 <td>92%</td> | |
279 <td>$1.5B</td> | |
280 </tr> | |
281 <tr> | |
282 <td class="title"><a href="http://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_2">Harry Potter and the Deathly Hallows—Part 2</a></td> | |
283 <td>4</td> | |
284 <td>2011</td> | |
285 <td>96%</td> | |
286 <td>$1.3B</td> | |
287 </tr> | |
288 <tr> | |
289 <td class="title"><a href="http://en.wikipedia.org/wiki/Frozen_(2013_film)">Frozen</a></td> | |
290 <td>5</td> | |
291 <td>2013</td> | |
292 <td>89%</td> | |
293 <td>$1.2B</td> | |
294 </tr> | |
295 <tr> | |
296 <td class="title"><a href="http://en.wikipedia.org/wiki/Iron_Man_3">Iron Man 3</a></td> | |
297 <td>6</td> | |
298 <td>2013</td> | |
299 <td>78%</td> | |
300 <td>$1.2B</td> | |
301 </tr> | |
302 <tr> | |
303 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Dark_of_the_Moon">Transformers: Dark of the Moon</a></td> | |
304 <td>7</td> | |
305 <td>2011</td> | |
306 <td>36%</td> | |
307 <td>$1.1B</td> | |
308 </tr> | |
309 <tr> | |
310 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Lord_of_the_Rings:_The_Return_of_the_King">The Lord of the Rings: The Return of the King</a></td> | |
311 <td>8</td> | |
312 <td>2003</td> | |
313 <td>95%</td> | |
314 <td>$1.1B</td> | |
315 </tr> | |
316 <tr> | |
317 <td class="title"><a href="http://en.wikipedia.org/wiki/Skyfall">Skyfall</a></td> | |
318 <td>9</td> | |
319 <td>2012</td> | |
320 <td>92%</td> | |
321 <td>$1.1B</td> | |
322 </tr> | |
323 <tr> | |
324 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Age_of_Extinction">Transformers: Age of Extinction</a></td> | |
325 <td>10</td> | |
326 <td>2014</td> | |
327 <td>18%</td> | |
328 <td>$1.0B</td> | |
329 </tr> | |
330 </tbody> | |
331 </table> | |
332 </div> | |
333 </div> | |
334 | |
335 </body> | |
336 </html> |