Debian Codegraph @

docs/example-widget-reflow.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery tablesorter 2.0 - Table Reflow Widget</title>
6
7 <!-- jQuery -->
8 <script src="js/jquery-latest.min.js"></script>
9
10 <!-- Demo stuff -->
11 <link class="ui-theme" rel="stylesheet" href="css/jquery-ui.min.css">
12 <script src="js/jquery-ui.min.js"></script>
13 <link rel="stylesheet" href="css/bootstrap-v3.min.css">
14 <script src="js/bootstrap.min.js"></script>
15 <link rel="stylesheet" href="css/jq.css">
16 <link href="css/tipsy.css" rel="stylesheet">
17 <link href="css/prettify.css" rel="stylesheet">
18 <script src="js/prettify.js"></script>
19 <script src="js/docs.js"></script>
20 <script src="js/jquery.tipsy.min.js"></script>
21
22 <!-- Tablesorter: required -->
23 <link rel="stylesheet" href="../css/theme.blue.css">
24 <script src="../js/jquery.tablesorter.js"></script>
25 <script src="../js/jquery.tablesorter.widgets.js"></script>
26
27 <style>
28 /* override bootstrap link colors */
29 .ui-widget-content a {
30 color: #428BCA;
31 }
32 .ui-widget-content a:hover {
33 text-decoration: underline;
34 }
35 /*** column selector custom css only popup ***/
36 .columnSelectorWrapper {
37 position: relative;
38 margin: 10px 0;
39 display: inline-block;
40 }
41 .columnSelector, .hidden {
42 display: none;
43 }
44 .columnSelectorButton {
45 background: #99bfe6;
46 border: #888 1px solid;
47 color: #111;
48 border-radius: 5px;
49 padding: 5px;
50 }
51 #colSelect1:checked + label {
52 background: #5797d7;
53 border-color: #555;
54 }
55 #colSelect1:checked ~ #columnSelector {
56 display: block;
57 }
58 .columnSelector {
59 width: 120px;
60 position: absolute;
61 top: 30px;
62 padding: 10px;
63 background: #fff;
64 border: #99bfe6 1px solid;
65 border-radius: 5px;
66 }
67 .columnSelector label {
68 display: block;
69 }
70 .columnSelector label:nth-child(1) {
71 border-bottom: #99bfe6 solid 1px;
72 margin-bottom: 5px;
73 }
74 .columnSelector input {
75 margin-right: 5px;
76 }
77 .columnSelector .disabled {
78 color: #ddd;
79 }
80 .frame-wrapper {
81 max-width: 100%;
82 transition: all 1s ease 0s;
83 }
84 iframe {
85 width: 100%;
86 height: 100%;
87 border: 0;
88 }
89 .sizes, .toggle {
90 display: inline-block;
91 height: 30px;
92 vertical-align: text-bottom;
93 }
94 .resize-frame {
95 list-style: none;
96 width: 250px;
97 height: 35px;
98 cursor: pointer;
99 padding: 5px;
100 margin: 0;
101 display: inline-block;
102 }
103 .resize-frame li {
104 background-image: url(img/screens.png);
105 background-repeat: no-repeat;
106 width: 35px;
107 height: 28px;
108 margin: 0;
109 padding: 0;
110 display: inline-block;
111 }
112 .resize-frame li:hover, .resize-frame li.active {
113 color: #00488c;
114 background-color: #eee;
115 background-image: url(img/screens-blue.png);
116 border-radius: 3px;
117 }
118 .resize-frame li.setauto {
119 vertical-align: top;
120 background-image: none;
121 font-weight: bold;
122 font-family: Menlo, Monaco, Consolas, monospace;
123 font-size: 12px;
124 text-indent: 4px;
125 padding-top: 4px;
126 }
127 .setdktp { background-position: 0 2px; }
128 .settbll { background-position: -35px 2px; }
129 .settblp { background-position: -70px 2px; }
130 .setsmtl { background-position: -105px 2px; }
131 .setsmtp { background-position: -142px 2px; }
132
133 .full { width: 100%; height: 420px; } /* full browser */
134 .desktop { width: 1440px; height: 420px; } /* desktop 1440x1024 */
135 .tablet-l { width: 1024px; height: 420px; } /* tablet landscape 1024x768 */
136 .tablet-p { width: 768px; height: 420px; } /* tablet portrait 768x1024 */
137 .smart-l { width: 480px; height: 320px; } /* smartphone landscape 480x320 */
138 .smart-p { width: 320px; height: 420px; } /* smartphone portrait 320x480 */
139 </style>
140 <script src="../js/widgets/widget-columnSelector.js"></script>
141
142 <style>
143 /* REQUIRED CSS: change your reflow breakpoint here (35em below) */
144 @media ( max-width: 35em ) {
145 .ui-table-reflow td,
146 .ui-table-reflow th {
147 -webkit-box-sizing: border-box;
148 -moz-box-sizing: border-box;
149 box-sizing: border-box;
150 float: right;
151 /* if not using the stickyHeaders widget (not the css3 version)
152 * the "!important" flag, and "height: auto" can be removed */
153 width: 100% !important;
154 height: auto !important;
155 }
156 /* reflow widget */
157 .ui-table-reflow tbody td[data-title]:before {
158 color: #469;
159 font-size: .9em;
160 content: attr(data-title);
161 float: left;
162 width: 50%;
163 white-space: pre-wrap;
164 text-align: bottom;
165 display: inline-block;
166 }
167 /* reflow2 widget */
168 table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
169 display: block;
170 padding: .4em 0;
171 margin: .4em 0;
172 text-transform: uppercase;
173 font-size: .9em;
174 font-weight: 400;
175 }
176 table.ui-table-reflow .ui-table-cell-label {
177 padding: .4em;
178 min-width: 30%;
179 display: inline-block;
180 margin: -.4em 1em -.4em -.4em;
181 }
182 }
183 .ui-table-reflow .ui-table-cell-label {
184 display: none;
185 }
186 </style>
187 <script src="../js/widgets/widget-reflow.js"></script>
188 <script>
189 $(function() {
190 // screen size class names
191 var j = 0,
192 allClasses = '',
193 sizes = [
194 [ 'full', '100% width' ],
195 [ 'desktop', 'Desktop 1440x1024' ],
196 [ 'tablet-l', 'Tablet landscape 1024x768' ],
197 [ 'tablet-p', 'tablet portrait 768x1024' ],
198 [ 'smart-l', 'smartphone landscape 480x320' ],
199 [ 'smart-p', 'smartphone portrait 320x480' ]
200 ];
201 $('.resize-frame li')
202 .each(function(i) {
203 // add tooltip to each table size button
204 $(this).attr('title', sizes[j][1]);
205 j = (j + 1) % 6;
206 if (i < 6) {
207 allClasses += sizes[i][0] + ' ';
208 }
209 })
210 .on('click', function() {
211 var $t = $(this),
212 indx = $t.index();
213 $t.addClass('active').siblings().removeClass('active');
214 $t.parent().nextAll('div:first').removeClass(allClasses).addClass( sizes[indx][0] );
215 });
216 // toggle thead in iframe
217 $('button.toggle').click(function() {
218 $(this).nextAll('div:first').find('iframe').contents().find('thead').toggleClass('hide-header');
219 });
220
221 // add tooltip
222 $('.resize-frame li, .toggle').tipsy({ gravity: 's' });
223
224 });
225 </script>
226 </head>
227 <body>
228
229 <div id="banner">
230 <h1>table<em>sorter</em></h1>
231 <h2>Table Reflow Widget</h2>
232 <h3>Flexible client-side table sorting</h3>
233 <a href="index.html">Back to documentation</a>
234 </div>
235
236 <div id="main">
237
238 <p></p>
239 <br>
240
241 <div class="accordion">
242
243 <h3><a href="#">Notes</a></h3>
244 <div>
245 <ul>
246 <li>This widget will <strong>only work</strong> in tablesorter version 2.8+, jQuery version 1.7+ and HTML5 (make sure the doctype is set as <code>&lt;!DOCTYPE html&gt;</code>).</li>
247 <li>The <strong>required css</strong>, shown below, is needed to make this widget work, but is completely customizable.</li>
248 <li>This demo sets the reflow breakpoint to 35em; so you'll need to resize your browser window to see this widget in action.</li>
249 <li>This widget is compatible with the column selector widget; but please note:
250 <ul>
251 <li>When a column is hidden, it will not show up when the table reflow occurs</li>
252 <li>For an example, see the second demo "Reflow + columnSelector widget" below.</li>
253 <li>The column selector widget, by default, has an additional breakpoint at "30em". So if the column selector is set to "Auto" and you continue to reduce the browser width after the table reflows, you'll see "Geometry" row disappear.</li>
254 </ul>
255 </li>
256 <li>It may not have been necessary to create two versions of this widget, but it was done because:
257 <ul>
258 <li>The first "reflow" widget does not add additional content to the tbody table cells, but it did not work well when attempting to add multiple content rows within the data-attribute. It would work if the css explicitly has the content set with a break like this (<a href="http://www.w3.org/TR/CSS2/generate.html#x18">ref</a>):
259 <pre class="prettyprint lang-css">content: "row1 \A row2";</pre>
260 But sadly, this method does not work when a data-attribute with the same content is used:
261 <pre class="prettyprint lang-css">content: attr(data-title);</pre>
262 The second method ignores the backslash and shows <code>"row1 \A row2"</code>
263 </li>
264 <li><span class="label label-info">Update</span>: After some discussion in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=988694">bugzilla</a>, I discovered that it is possible to add multiple lines of content using a data-attribute by setting a <code>white-space: pre;</code> css definition and using <code>&amp;#10</code> instead of <code>\A</code> (<a href="https://jsfiddle.net/96pwE/5/">demo</a>), but I think I'll keep the second reflow version because it actually allows styling.</li>
265 <li>Adding bold elements to every table tbody cell is the method used by jQuery Mobile; so, a second reflow widget "reflow2" was created to do the same, and work properly with a thead containing multiple rows.</li>
266 </ul>
267 </li>
268 <li>
269 If you do not want the sortable headers to show when the table reflows, include this css within the media query:<br>
270 <br>
271 <pre class="prettyprint lang-css">table.ui-table-reflow thead { display: none; }</pre>
272 </li>
273 </ul>
274 </div>
275
276 <h3><a href="#">Reflow Widget</a></h3>
277 <div>
278 <ul>
279 <li>This version adds a <code>data-title</code> attribute (modifiable by the <code>reflow_dataAttrib</code> option), to every table body cell.</li>
280 <li>The required css shows the contents of this data-attribute when the browser width reaches the set break point.</li>
281 <li>So, this widget does not add any additional content to the table cells; which might be preferred if the table content should not be changed.</li>
282 <li>Do not use this version of the widget for a table with more than one header row.</li>
283 </ul>
284
285 <h4>Reflow widget default options (added inside of tablesorter <code>widgetOptions</code>)</h4>
286 <table class="tablesorter-blue">
287 <thead>
288 <tr><th>Option</th><th>Description</th></tr>
289 </thead>
290 <tbody>
291
292 <tr class="odd">
293 <td>reflow_className</td>
294 <td>
295 This class name is added to the table to make it responsive. The class name is the same as that used by <a href="http://demos.jquerymobile.com/1.4.2/table-reflow/">jQuery Mobile</a>.<br>
296 <br>
297 <pre class="prettyprint lang-html">&lt;table class=&quot;tablesorter tablesorter-blue ui-table-reflow&quot;&gt;...&lt;/table&gt;</pre>
298 <br>
299 Default value: <code>&quot;ui-table-reflow&quot;</code>
300 </td>
301 </tr>
302 <tr>
303 <td>reflow_headerAttrib</td>
304 <td>
305 Set this option to use your desired data-attribute. The set data-attribute contains the alternative header title added to every table body cell when the table reflows.<br>
306 <br>
307 For example, the "Sex" column below is renamed to "Gender" within the reflow cells:
308 <pre class="prettyprint lang-html">&lt;th data-name=&quot;Gender&quot;&gt;Sex&lt;/th&gt;</pre>
309 <br>
310 Default value: <code>&quot;data-name&quot;</code>
311 </td>
312 </tr>
313 <tr class="odd">
314 <td>reflow_dataAttrib</td>
315 <td>
316 Set this option to use your desired data-attribute which is added to every table body cell. It will contain the header name which is shown once the table reflows.<br>
317 <br>
318 For example, all of table body cells will show the contents from the set data-attribute when the table reflows:
319 <pre class="prettyprint lang-html">&lt;td data-title=&quot;Gender&quot;&gt;female&lt;/td&gt;</pre>
320 <br>
321 Default value: <code>&quot;data-title&quot;</code>
322 </td>
323 </tr>
324
325 </tbody>
326 </table>
327 </div>
328
329 <h3><a href="#">Reflow2 Widget</a></h3>
330 <div>
331 <ul>
332 <li>This version of the reflow widget adds a bold element (<code>&lt;b&gt;</code>), containing the header cell name, to every table body cell.</li>
333 <li>The required css shows these elements when the browser width reaches the set break point.</li>
334 <li>Use this version of the widget for a table with <strong>more than one</strong> header row.</li>
335 <li>So, this widget does add additional content to the table tbody cells; this might not be preferred if the table content should not be changed.</li>
336 <li>If an update occurs, this widget will remove all cell elements, and replace them, even if the headers have changed.</li>
337 <li>In very large tables, initialization of the table may be slightly delayed.</li>
338 </ul>
339
340 <h4>Reflow2 widget default options (added inside of tablesorter <code>widgetOptions</code>)</h4>
341 <table class="tablesorter-blue">
342 <thead>
343 <tr><th>Option</th><th>Description</th></tr>
344 </thead>
345 <tbody>
346
347 <tr class="odd">
348 <td>reflow2_className</td>
349 <td>
350 This class name is added to the table to make it responsive. The class name is the same as that used by <a href="http://demos.jquerymobile.com/1.4.2/table-reflow/">jQuery Mobile</a>.<br>
351 <br>
352 <pre class="prettyprint lang-html">&lt;table class=&quot;tablesorter tablesorter-blue ui-table-reflow&quot;&gt;...&lt;/table&gt;</pre>
353 <br>
354 Default value: <code>&quot;ui-table-reflow&quot;</code>
355 </td>
356 </tr>
357 <tr>
358 <td>reflow2_classIgnore</td>
359 <td>
360 Set this option to use your desired class name. Any header cell with this class name will have it's contents ignored.<br>
361 <br>
362 For example, this is the "Paris" header cell in table3 below:
363 <pre class="prettyprint lang-html">&lt;th class="ui-table-reflow-ignore sorter-false"&gt;Paris&lt;/th&gt;</pre>
364 <br>
365 Default value: <code>&quot;ui-table-reflow-ignore&quot;</code>
366 </td>
367 </tr>
368 <tr class="odd">
369 <td>reflow2_headerAttrib</td>
370 <td>
371 Set this option to use your desired data-attribute. The set data-attribute contains the alternative header title added to every table body cell when the table reflows.<br>
372 <br>
373 For example, the "Sex" column below is renamed to "Gender" within the reflow cells:
374 <pre class="prettyprint lang-html">&lt;th data-name=&quot;Gender&quot;&gt;Sex&lt;/th&gt;</pre>
375 <br>
376 Default value: <code>&quot;data-name&quot;</code>
377 </td>
378 </tr>
379 <tr>
380 <td>reflow2_labelClass</td>
381 <td>
382 Set this option to use your desired class name.<br>
383 <br>
384 When the table reflows, the bold element (<code>&lt;b&gt;</code>) with this class name will be revealed; it must also be defined within the media query to display this element as an "inline-block", so it shares the row with the cell content
385 <h4>CSS</h4>
386 <pre class="prettyprint lang-css">/* additional selectors needed to increase css specificity */
387 table.ui-table-reflow .ui-table-cell-label {
388 padding: .4em;
389 min-width: 30%;
390 display: inline-block;
391 margin: -.4em 1em -.4em -.4em;
392 }</pre>
393 <h4>HTML</h4>
394 <pre class="prettyprint lang-html">&lt;th&gt;
395 &lt;b class="remove-me ui-table-cell-label"&gt;Month&lt;/b&gt;
396 January
397 &lt;/th&gt;</pre>
398 <br>
399 Default value: <code>&quot;ui-table-cell-label&quot;</code>
400 </td>
401 </tr>
402 <tr class="odd">
403 <td>reflow2_labelTop</td>
404 <td>
405 Set this option to use your desired class name.<br>
406 <br>
407 When the table reflows, the all upper header cell content is also included in every corresponding column table cell within a bold element (<code>&lt;b&gt;</code>); it must also be defined within the media query to display this element as a "block"
408 <h4>CSS</h4>
409 <pre class="prettyprint lang-css">/* additional selectors needed to increase css specificity */
410 table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
411 display: block;
412 padding: .4em 0;
413 margin: .4em 0;
414 text-transform: uppercase;
415 font-size: .9em;
416 font-weight: 400;
417 }</pre>
418 <h4>HTML</h4>
419 <pre class="prettyprint lang-html">&lt;td&gt;
420 &lt;b class="remove-me ui-table-cell-label ui-table-cell-label-top"&gt;Average Temperatures (C)&lt;/b&gt;
421 &lt;b class="remove-me ui-table-cell-label">Minimum Temp&lt;/b&gt;
422 3
423 &lt;/td&gt;
424 </pre>
425 <br>
426 Default value: <code>&quot;ui-table-cell-label-top&quot;</code>
427 </td>
428 </tr>
429
430 </tbody>
431 </table>
432
433 </div>
434
435 <h3><a href="#">Required CSS</a></h3>
436 <div>
437 The reflow widgets require the following css to hide/show header cell content within each table cell. Remove the css for whichever reflow widget that is not being used, as desired.<br>
438 <br>
439 <pre class="prettyprint lang-css">/* REQUIRED CSS: change your reflow breakpoint here (35em below) */
440 @media ( max-width: 35em ) {
441
442 /* uncomment out the line below if you don't want the sortable headers to show */
443 /* table.ui-table-reflow thead { display: none; } */
444
445 /* css for reflow & reflow2 widgets */
446 .ui-table-reflow td,
447 .ui-table-reflow th {
448 -webkit-box-sizing: border-box;
449 -moz-box-sizing: border-box;
450 box-sizing: border-box;
451 float: right;
452 /* if not using the stickyHeaders widget (not the css3 version)
453 * the "!important" flag, and "height: auto" can be removed */
454 width: 100% !important;
455 height: auto !important;
456 }
457
458 /* reflow widget only */
459 .ui-table-reflow tbody td[data-title]:before {
460 color: #469;
461 font-size: .9em;
462 content: attr(data-title);
463 float: left;
464 width: 50%;
465 white-space: pre-wrap;
466 text-align: bottom;
467 display: inline-block;
468 }
469
470 /* reflow2 widget only */
471 table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top {
472 display: block;
473 padding: .4em 0;
474 margin: .4em 0;
475 text-transform: uppercase;
476 font-size: .9em;
477 font-weight: 400;
478 }
479 table.ui-table-reflow .ui-table-cell-label {
480 padding: .4em;
481 min-width: 30%;
482 display: inline-block;
483 margin: -.4em 1em -.4em -.4em;
484 }
485
486 } /* end media query */
487
488 /* reflow2 widget */
489 .ui-table-reflow .ui-table-cell-label {
490 display: none;
491 }</pre>
492 </div>
493
494 </div>
495
496 <p></p>
497
498 <h1>Demo <small>(Pick a table width or resize the browser window)</small></h1>
499 <div id="demo"><h3>Reflow widget only</h3>
500 <span class="sizes">Set table width:</span>
501 <ul class="resize-frame">
502 <li class="setauto active">Auto</li>
503 <li class="setdktp"></li>
504 <li class="settbll"></li>
505 <li class="settblp"></li>
506 <li class="setsmtl"></li>
507 <li class="setsmtp"></li>
508 </ul>
509 <button type="button" class="toggle" title="Hide/show table header when the breakpoint is reached">Toggle Headers</button>
510 <div class="frame-wrapper full">
511 <iframe src="example-widget-reflow1.html"></iframe>
512 </div>
513
514 <h3>Reflow + columnSelector widget</h3>
515 <span class="sizes">Set table width:</span>
516 <ul class="resize-frame">
517 <li class="setauto active">Auto</li>
518 <li class="setdktp"></li>
519 <li class="settbll"></li>
520 <li class="settblp"></li>
521 <li class="setsmtl"></li>
522 <li class="setsmtp"></li>
523 </ul>
524 <button type="button" class="toggle" title="Hide/show table header when the breakpoint is reached">Toggle Headers</button>
525 <div class="frame-wrapper full">
526 <iframe src="example-widget-reflow2.html"></iframe>
527 </div>
528
529 <h3>Reflow2 widget (multiple thead rows)</h3>
530 <span class="sizes">Set table width:</span>
531 <ul class="resize-frame">
532 <li class="setauto active">Auto</li>
533 <li class="setdktp"></li>
534 <li class="settbll"></li>
535 <li class="settblp"></li>
536 <li class="setsmtl"></li>
537 <li class="setsmtp"></li>
538 </ul>
539 <button type="button" class="toggle" title="Hide/show table header when the breakpoint is reached">Toggle Headers</button>
540 <div class="frame-wrapper full">
541 <iframe src="example-widget-reflow3.html"></iframe>
542 </div>
543
544 </div>
545
546 <h1>HTML</h1>
547 <div>
548 <pre class="prettyprint lang-html">&lt;h3&gt;Reflow widget only&lt;/h3&gt;
549 &lt;table id=&quot;table1&quot;&gt;
550 &lt;thead&gt;
551 &lt;tr&gt;
552 &lt;th&gt;Rank&lt;/th&gt;
553 &lt;th&gt;Age&lt;/th&gt;
554 &lt;th&gt;Total&lt;/th&gt;
555 &lt;th&gt;Discount&lt;/th&gt;
556 &lt;th&gt;Date&lt;/th&gt;
557 &lt;/tr&gt;
558 &lt;/thead&gt;
559 &lt;tbody&gt;
560 &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;$5.95&lt;/td&gt;&lt;td&gt;22%&lt;/td&gt;&lt;td&gt;Jun 26, 2013 7:22 AM&lt;/td&gt;&lt;/tr&gt;
561 &lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;$82.99&lt;/td&gt;&lt;td&gt;5%&lt;/td&gt;&lt;td&gt;Aug 21, 2013 12:21 PM&lt;/td&gt;&lt;/tr&gt;
562 &lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;$99.29&lt;/td&gt;&lt;td&gt;18%&lt;/td&gt;&lt;td&gt;Oct 13, 2013 1:15 PM&lt;/td&gt;&lt;/tr&gt;
563 &lt;tr&gt;&lt;td&gt;51&lt;/td&gt;&lt;td&gt;28&lt;/td&gt;&lt;td&gt;$9.99&lt;/td&gt;&lt;td&gt;20%&lt;/td&gt;&lt;td&gt;Jul 6, 2013 8:14 AM&lt;/td&gt;&lt;/tr&gt;
564 &lt;tr&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;33&lt;/td&gt;&lt;td&gt;$19.99&lt;/td&gt;&lt;td&gt;25%&lt;/td&gt;&lt;td&gt;Dec 10, 2012 5:14 AM&lt;/td&gt;&lt;/tr&gt;
565 &lt;tr&gt;&lt;td&gt;013&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;$65.89&lt;/td&gt;&lt;td&gt;45%&lt;/td&gt;&lt;td&gt;Jan 12, 2013 11:14 AM&lt;/td&gt;&lt;/tr&gt;
566 &lt;tr&gt;&lt;td&gt;005&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt;$153.19&lt;/td&gt;&lt;td&gt;45%&lt;/td&gt;&lt;td&gt;Jan 18, 2014 9:12 AM&lt;/td&gt;&lt;/tr&gt;
567 &lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;$5.29&lt;/td&gt;&lt;td&gt;4%&lt;/td&gt;&lt;td&gt;Jan 8, 2013 5:11 PM&lt;/td&gt;&lt;/tr&gt;
568 &lt;tr&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;$14.19&lt;/td&gt;&lt;td&gt;14%&lt;/td&gt;&lt;td&gt;Jan 14, 2014 11:23 AM&lt;/td&gt;&lt;/tr&gt;
569 &lt;tr&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;$13.19&lt;/td&gt;&lt;td&gt;11%&lt;/td&gt;&lt;td&gt;Jan 18, 2013 9:12 AM&lt;/td&gt;&lt;/tr&gt;
570 &lt;tr&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;$55.20&lt;/td&gt;&lt;td&gt;15%&lt;/td&gt;&lt;td&gt;Feb 12, 2013 7:23 PM&lt;/td&gt;&lt;/tr&gt;
571 &lt;tr&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;$123.00&lt;/td&gt;&lt;td&gt;32%&lt;/td&gt;&lt;td&gt;Jan 20, 2014 1:12 PM&lt;/td&gt;&lt;/tr&gt;
572 &lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;$22.09&lt;/td&gt;&lt;td&gt;17%&lt;/td&gt;&lt;td&gt;Jun 11, 2013 10:55 AM&lt;/td&gt;&lt;/tr&gt;
573 &lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;$19.99&lt;/td&gt;&lt;td&gt;18%&lt;/td&gt;&lt;td&gt;Jan 20, 2014 7:45 PM&lt;/td&gt;&lt;/tr&gt;
574 &lt;tr&gt;&lt;td&gt;73&lt;/td&gt;&lt;td&gt;58&lt;/td&gt;&lt;td&gt;$129.19&lt;/td&gt;&lt;td&gt;39%&lt;/td&gt;&lt;td&gt;Jan 20, 2014 10:11 AM&lt;/td&gt;&lt;/tr&gt;
575 &lt;/tbody&gt;
576 &lt;/table&gt;
577
578 &lt;h3&gt;Reflow columnSelector widget&lt;/h3&gt;
579 &lt;!-- This selector markup is completely customizable --&gt;
580 &lt;div class=&quot;columnSelectorWrapper&quot;&gt;
581 &lt;input id=&quot;colSelect1&quot; type=&quot;checkbox&quot; class=&quot;hidden&quot;&gt;
582 &lt;label class=&quot;columnSelectorButton&quot; for=&quot;colSelect1&quot;&gt;Column&lt;/label&gt;
583 &lt;div id=&quot;columnSelector&quot; class=&quot;columnSelector&quot;&gt;
584 &lt;!-- this div is where the column selector is added --&gt;
585 &lt;/div&gt;
586 &lt;/div&gt; (When &quot;Auto&quot; is set, the table becomes responsive; resize the browser window to see it work)
587
588 &lt;table id=&quot;table2&quot;&gt;
589 &lt;thead&gt;
590 &lt;tr&gt;
591 &lt;th data-priority=&quot;critical&quot;&gt;Name&lt;/th&gt;
592 &lt;th data-priority=&quot;critical&quot;&gt;Major&lt;/th&gt;
593 &lt;th data-priority=&quot;6&quot; data-name=&quot;Gender&quot;&gt;Sex&lt;/th&gt;
594 &lt;th data-priority=&quot;4&quot;&gt;English&lt;/th&gt;
595 &lt;th data-priority=&quot;5&quot;&gt;Japanese&lt;/th&gt;
596 &lt;th data-priority=&quot;3&quot;&gt;Calculus&lt;/th&gt;
597 &lt;th data-priority=&quot;2&quot;&gt;Geometry&lt;/th&gt;
598 &lt;/tr&gt;
599 &lt;/thead&gt;
600 &lt;tfoot&gt;
601 &lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Major&lt;/th&gt;&lt;th&gt;Sex&lt;/th&gt;&lt;th&gt;English&lt;/th&gt;&lt;th&gt;Japanese&lt;/th&gt;&lt;th&gt;Calculus&lt;/th&gt;&lt;th&gt;Geometry&lt;/th&gt;&lt;/tr&gt;
602 &lt;/tfoot&gt;
603 &lt;tbody&gt;
604 &lt;tr&gt;&lt;td&gt;Student03&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;/tr&gt;
605 &lt;tr&gt;&lt;td&gt;Student04&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;60&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;/tr&gt;
606 &lt;tr&gt;&lt;td&gt;Student05&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;/tr&gt;
607 &lt;tr&gt;&lt;td&gt;Student12&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;/tr&gt;
608 &lt;tr&gt;&lt;td&gt;Student13&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
609 &lt;tr&gt;&lt;td&gt;Student14&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
610 &lt;tr&gt;&lt;td&gt;Student15&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;td&gt;35&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
611 &lt;tr&gt;&lt;td&gt;Student16&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;/tr&gt;
612 &lt;tr&gt;&lt;td&gt;Student17&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;female&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;/tr&gt;
613 &lt;tr&gt;&lt;td&gt;Student18&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;49&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;/tr&gt;
614 &lt;tr&gt;&lt;td&gt;Student19&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;88&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;/tr&gt;
615 &lt;tr&gt;&lt;td&gt;Student20&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;45&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;/tr&gt;
616 &lt;tr&gt;&lt;td&gt;Student01&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;70&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;/tr&gt;
617 &lt;tr&gt;&lt;td&gt;Student02&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;88&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
618 &lt;tr&gt;&lt;td&gt;Student06&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
619 &lt;tr&gt;&lt;td&gt;Student07&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;68&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
620 &lt;tr&gt;&lt;td&gt;Student08&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;/tr&gt;
621 &lt;tr&gt;&lt;td&gt;Student09&lt;/td&gt;&lt;td&gt;Mathematics&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;80&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;/tr&gt;
622 &lt;tr&gt;&lt;td&gt;Student10&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;90&lt;/td&gt;&lt;/tr&gt;
623 &lt;tr&gt;&lt;td&gt;Student11&lt;/td&gt;&lt;td&gt;Languages&lt;/td&gt;&lt;td&gt;male&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;/tr&gt;
624 &lt;/tbody&gt;
625 &lt;/table&gt;
626
627 &lt;h3&gt;Reflow2 widget (multiple thead rows)&lt;/h3&gt;
628 &lt;table id=&quot;table3&quot;&gt;
629 &lt;thead&gt;
630 &lt;tr&gt;
631 &lt;th class=&quot;ui-table-reflow-ignore sorter-false&quot;&gt;Paris&lt;/th&gt;
632 &lt;th colspan=&quot;2&quot;&gt;Average Temperatures (C)&lt;/th&gt;
633 &lt;th colspan=&quot;2&quot;&gt;Average Rainfall&lt;/th&gt;
634 &lt;/tr&gt;
635 &lt;tr&gt;
636 &lt;th&gt;Month&lt;/th&gt;
637 &lt;th&gt;Minimum Temp&lt;/th&gt;
638 &lt;th&gt;Maximum Temp&lt;/th&gt;
639 &lt;th&gt;Precipitaion (mm)&lt;/th&gt;
640 &lt;th&gt;Rainfall Days&lt;/th&gt;
641 &lt;/tr&gt;
642 &lt;/thead&gt;
643 &lt;tbody&gt;
644 &lt;tr&gt;&lt;th&gt;January&lt;/th&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;17.8&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;/tr&gt;
645 &lt;tr&gt;&lt;th&gt;February&lt;/th&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;21.7&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;
646 &lt;tr&gt;&lt;th&gt;March&lt;/th&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;24.2&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;/tr&gt;
647 &lt;tr&gt;&lt;th&gt;April&lt;/th&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;24.6&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;/tr&gt;
648 &lt;tr&gt;&lt;th&gt;May&lt;/th&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;26.2&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;/tr&gt;
649 &lt;tr&gt;&lt;th&gt;June&lt;/th&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;25.1&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;/tr&gt;
650 &lt;tr&gt;&lt;th&gt;July&lt;/th&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;21.7&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;
651 &lt;tr&gt;&lt;th&gt;August&lt;/th&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;21.4&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;
652 &lt;tr&gt;&lt;th&gt;September&lt;/th&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;15.6&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;/tr&gt;
653 &lt;tr&gt;&lt;th&gt;October&lt;/th&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;25.3&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;/tr&gt;
654 &lt;tr&gt;&lt;th&gt;November&lt;/th&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;22.4&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;
655 &lt;tr&gt;&lt;th&gt;December&lt;/th&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;26.6&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;
656 &lt;/tbody&gt;
657 &lt;/table&gt;</pre>
658 </div>
659
660 <h1>Javascript</h1>
661 <div>
662 <pre class="prettyprint lang-js">$(function() {
663
664 // simple reflow widget (table with 1 header row)
665 $("#table1").tablesorter({
666 theme: 'blue',
667 widgets: ['zebra', 'reflow'],
668 widgetOptions : {
669 // class name added to make it responsive (class name within media query)
670 reflow_className : 'ui-table-reflow',
671 // header attribute containing modified header name
672 reflow_headerAttrib : 'data-name',
673 // data attribute added to each tbody cell
674 // it contains the header cell text, visible upon reflow
675 reflow_dataAttrib : 'data-title'
676 }
677 });
678
679 // simple reflow widget + columnSelector & stickyHeaders widgets
680 $("#table2").tablesorter({
681 theme: 'blue',
682 widgets: ['zebra', 'reflow', 'columnSelector', 'stickyHeaders'],
683 widgetOptions : {
684 // target the column selector markup
685 columnSelector_container : $('#columnSelector'),
686 // data attribute containing column name to use in the selector container
687 // make it use the same as reflow_headerAttrib
688 columnSelector_name : 'data-name',
689
690 // header attribute containing modified header name
691 reflow_headerAttrib : 'data-name'
692 }
693 });
694
695 // reflow2 widget (table with multiple header rows)
696 $("#table3").tablesorter({
697 theme: 'blue',
698 widgets: ['zebra', 'reflow2'],
699 widgetOptions: {
700 // class name added to make it responsive (class name within media query)
701 reflow2_className : 'ui-table-reflow',
702 // ignore header cell content with this class name
703 reflow2_classIgnore : 'ui-table-reflow-ignore',
704 // header attribute containing modified header name
705 reflow2_headerAttrib : 'data-name',
706 // class name applied to thead labels
707 reflow2_labelClass : 'ui-table-cell-label',
708 // class name applied to first row thead label
709 reflow2_labelTop : 'ui-table-cell-label-top'
710 }
711 });
712
713 });</pre>
714 </div>
715
716 </div>
717
718 </body>
719 </html>