Debian Codegraph @

docs/example-widget-css-sticky-header.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery tablesorter 2.0 - CSS Sticky Header Widget</title>
6
7 <!-- jQuery -->
8 <script src="js/jquery-latest.min.js"></script>
9 <script src="js/jquery-ui.min.js"></script>
10
11 <!-- Demo stuff -->
12 <link rel="stylesheet" href="css/jquery-ui.min.css">
13 <link rel="stylesheet" href="css/jq.css">
14 <link rel="stylesheet" href="css/prettify.css">
15 <link rel="stylesheet" href="css/magnific-popup.css">
16 <script src="js/prettify.js"></script>
17 <script src="js/docs.js"></script>
18 <script src="js/jquery.magnific-popup.min.js"></script>
19
20 <!-- Tablesorter: theme -->
21 <link class="theme" rel="stylesheet" href="../css/theme.default.css">
22 <link class="theme" rel="stylesheet" href="../css/theme.blue.css">
23 <link class="theme" rel="stylesheet" href="../css/theme.green.css">
24 <link class="theme" rel="stylesheet" href="../css/theme.grey.css">
25 <link class="theme" rel="stylesheet" href="../css/theme.ice.css">
26 <link class="theme" rel="stylesheet" href="../css/theme.black-ice.css">
27 <link class="theme" rel="stylesheet" href="../css/theme.dark.css">
28 <link class="theme" rel="stylesheet" href="../css/theme.dropbox.css">
29 <link class="theme" rel="stylesheet" href="../css/theme.metro-dark.css">
30
31 <style>
32 #main h3 { margin-top: 20px; }
33 #main .accordion h3 { margin-top: 0; }
34 </style>
35
36 <style id="css">/* wrapper of table 2 */
37 .wrapper {
38 position: relative;
39 top: 50px;
40 height: 250px;
41 overflow-x: auto;
42 }
43
44 /* Magnific popup */
45 #popup {
46 position: relative;
47 background: #FFF;
48 padding: 20px;
49 width: auto;
50 max-width: 500px;
51 margin: 20px auto;
52 }</style>
53
54 <!-- Tablesorter script: required -->
55 <script src="../js/jquery.tablesorter.js"></script>
56 <script src="../js/jquery.tablesorter.widgets.js"></script>
57 <script src="../js/widgets/widget-cssStickyHeaders.js"></script>
58
59 <script id="js">$(function() {
60
61 $('.open-popup-link').magnificPopup({
62 type: 'inline',
63 midClick: true,
64 callbacks: {
65 open: function () {
66 // Will fire when this exact popup is opened
67 // this - is Magnific Popup object
68 $('#table0').tablesorter({
69 theme: 'blue',
70 headerTemplate : '{content} {icon}', // Add icon for various themes
71 widgets: ['zebra', 'filter', 'cssStickyHeaders'],
72 widgetOptions: {
73 // caption set by demo button value
74 cssStickyHeaders_addCaption: addCaption,
75 // jQuery selector or object to attach sticky header to
76 cssStickyHeaders_attachTo: '.mfp-wrap',
77 cssStickyHeaders_filteredToTop : true,
78 cssStickyHeaders_offset: 0
79 }
80 });
81 }
82 }
83 });
84
85 $('#table1, .nested, #table3').tablesorter({
86 widthFixed : true,
87 headerTemplate: '{content} {icon}', // Add icon for jui theme; new in v2.7!
88
89 widgets: [ 'zebra', 'cssStickyHeaders', 'filter' ],
90
91 widgetOptions: {
92 cssStickyHeaders_addCaption : true,
93 // jQuery selector or object to attach sticky header to
94 cssStickyHeaders_attachTo : null,
95 cssStickyHeaders_filteredToTop : true,
96 cssStickyHeaders_offset : 0
97 }
98
99 });
100
101 $('#table2').tablesorter({
102 widthFixed : true,
103 headerTemplate: '{content} {icon}', // Add icon for jui theme; new in v2.7!
104
105 widgets: [ 'zebra', 'cssStickyHeaders', 'filter' ],
106
107 widgetOptions: {
108 cssStickyHeaders_attachTo : '.wrapper', // or $('.wrapper')
109 cssStickyHeaders_addCaption : true
110 }
111
112 });
113
114 });</script>
115 <script>
116 $(function() {
117 $('link.theme').each(function() { this.disabled = true; });
118
119 var themes = 'blue default green grey ice black-ice dark dropbox',
120 i, o = '', t = themes.split(' ');
121 for (i = 0; i < t.length; i++) {
122 o += '<option value="' + t[i] + '">' + t[i] + '</option>';
123 }
124
125 $('select:first')
126 .append(o)
127 .change(function() {
128 var theme = $(this).val().toLowerCase(),
129 files = $('link.theme').each(function() {
130 this.disabled = true;
131 })
132 files.filter('[href$="theme.' + theme + '.css"]').each(function() {
133 this.disabled = false;
134 });
135 $('table')
136 .removeClass('tablesorter-' + t.join(' tablesorter-') + ' tablesorter-jui')
137 .addClass('tablesorter-' + (theme === 'black-ice' ? 'blackice' : theme) );
138 }).change();
139
140 window.addCaption = true;
141 $('.caption').on('click', function() {
142 addCaption = !addCaption;
143 $(this).html( '' + addCaption );
144 $('#table0, #table1, #table2, #table3, .nested').each(function() {
145 if (this.config) {
146 this.config.widgetOptions.cssStickyHeaders_addCaption = addCaption;
147 }
148 });
149 });
150
151 });
152 </script>
153 </head>
154 <body>
155
156 <div id="banner">
157 <h1>table<em>sorter</em></h1>
158 <h2>CSS Sticky Header Widget</h2>
159 <h3>Flexible client-side table sorting</h3>
160 <a href="index.html">Back to documentation</a>
161 </div>
162
163 <div id="main">
164
165 <p></p>
166 <br>
167
168 <div id="root" class="accordion">
169
170 <h3><a href="#">Notes</a></h3>
171 <div>
172 <ul>
173 <li>In <span class="version">v2.18.4</span>, added a <a href="http://dimsemenov.com/plugins/magnific-popup/">Magnific popup</a> example to this page.</li>
174 <li>In <span class="version">v2.18.1</span>, <code>cssStickyHeaders_addCaption</code> issue fixed &amp; nested tables in IE now work properly.</li>
175 <li>This demo uses the CSS Sticky Headers widget which uses <em>CSS transforms</em> to reposition the table head.</li>
176 <li><a href="http://caniuse.com/#search=transform">CSS transforms</a> are supported by most modern browsers (<strong>not IE8 and older</strong>).</li>
177 <li>The jQuery UI themed table does not stick to the top of the page due to the extra padding. Adjust the <code>cssStickyHeaders_offset</code> option as desired. I didn't bother in this demo because it includes more than just the jQuery UI theme.<br><br></li>
178 <li>This widget <em>will not work</em> with the original tablesorter, but works optimally with tablesorter v2.8+ (Added <span class="version">v2.14.1</span>; Updated <span class="version updated">v2.18.1</span>)</li>
179 </ul>
180 </div>
181
182 <h3><a href="#">Options</a></h3>
183 <div>
184 <h4>cssStickyHeaders widget defaults</h4>
185 <div>
186 <span class="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <a href="#" class="toggleAll">toggle</a>|<a href="#" class="showAll">show</a>|<a href="#" class="hideAll">hide</a> all) or double click to update the browser location.
187 </div>
188 <table class="options tablesorter-blue" data-sortlist="[[0,0]]">
189 <thead>
190 <tr><th>Option</th><th>Default</th><th class="sorter-false">Description</th></tr>
191 </thead>
192 <tbody>
193
194 <tr id="cssstickyheaders-offset">
195 <td><span class="permalink">cssStickyHeaders_offset</span></td>
196 <td>0</td>
197 <td>Set this to a number (in pixels) or jquery selector targeting the <code>position:fixed</code> element in which to place the sticky header below while scrolling.</td>
198 </tr>
199
200 <tr id="cssstickyheaders-includecaption">
201 <td><span class="permalink">cssStickyHeaders_includeCaption</span></td>
202 <td>true</td>
203 <td>If <code>false</code> and a table caption exist, it won't be included in the sticky header.</td>
204 </tr>
205
206 <tr id="cssstickyheaders-attachto">
207 <td><a href="#" class="permalink">cssStickyHeaders_attachTo</a></td>
208 <td>null</td>
209 <td>Set this option as a jQuery selector or object where the sticky header will be attached.
210 <div class="collapsible">
211 <ul>
212 <li>Setting this option with either a jQuery selector string (<code>&quot;.wrapper&quot;</code>) or jQuery object (<code>$(&quot;.wrapper&quot;)</code>).</li>
213 <li>This option contains the target to which the sticky header will attach - see the <a href="#popup-header">first example</a> below.</li>
214 </ul>
215 </div>
216 </td>
217 </tr>
218
219 <tr id="cssstickyheaders-filteredtotop">
220 <td><a href="#" class="permalink">cssStickyHeaders_filteredToTop</a></td>
221 <td>true</td>
222 <td>Scroll table top into view after filtering
223 <div class="collapsible">
224 <br>
225 This is needed when the user choses to filter the table which results in fewer rows than are currently visible in the browser viewport. So, the sticky header may still exist, but the table body may not be seen. Setting this option to <code>true</code> forces the original table header to scroll back into view.
226 </div>
227 </td>
228 </tr>
229 </tbody>
230 </table>
231 </div>
232
233 <h3><a href="#">Change log</a></h3>
234 <div>
235 <ul>
236 <li><span class="version">v2.18.1</span>:
237 <ul>
238 <li>Nested css sticky headers in IE now work as expected</li>
239 <li>Fixed an issue in Chrome where the height of the caption was still included even though the <code>cssStickyHeaders_addCaption</code> was set to <code>false</code>.</li>
240 </ul>
241 </li>
242 <li><span class="version">v2.18.0</span>:
243 <ul>
244 <li>Nested css sticky headers now stack; except in IE</li>
245 <li>Removed <code>cssStickyHeaders_zIndex</code> because the headers are not positioned.</li>
246 </ul>
247 </li>
248 <li><span class="version">v2.16.4</span>:
249 <ul>
250 <li>Added the <code>cssStickyHeaders_filteredToTop</code> option.
251 <ul>
252 <li>When <code>true</code> the table top will scroll into view after being filtered.</li>
253 <li>This is done because if the sticky header is active, and a filter results in say only one row, the table will scroll up out of the browser viewport.</li>
254 <li>If set to <code>false</code>, no scrolling is done.</li>
255 </ul>
256 </li>
257 </ul>
258 </li>
259 <li><span class="version">v2.14.4</span>:
260 <ul>
261 <li>Added <code>cssStickyHeaders_attachTo</code> (default set to <code>null</code>). Setting this option with either a jQuery selector string (<code>&quot;.wrapper&quot;</code>) or jQuery object (<code>$(&quot;.wrapper&quot;)</code>) to attach the sticky header to this element - see the second example below.</li>
262 <li>Removed <code>cssStickyHeaders_offsetX</code> option.</li>
263 <li>Renamed <code>cssStickyHeaders_offsetY</code> to <code>cssStickyHeaders_offset</code> as the horizontal offset is not required.</li>
264 </ul>
265 </li>
266 <li>v2.14.1: Created css Sticky Headers widget</li>
267 </ul>
268 </div>
269
270 </div>
271 <p></p>
272
273 <h1>CSS</h1>
274 <div id="css">
275 <pre class="prettyprint lang-css"></pre>
276 </div>
277
278 <h1>Javascript</h1>
279 <div id="javascript">
280 <pre class="prettyprint lang-javascript"></pre>
281 </div>
282
283 <h1>Demo</h1>
284 Choose Theme: <select></select>
285 <p></p>
286 Include Caption: <button type="button" class="caption">true</button>
287 <p></p>
288
289 <h3 id="popup-header">Sticky headers in a popup window</h3>
290 <a href="#popup" class="open-popup-link">Show table in Magnific popup window</a>
291
292 <div id="popup" class="white-popup mfp-hide">
293 <table id="table0" class="tablesorter">
294 <caption>Student Grades</caption>
295 <thead>
296 <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th class="filter-false sorter-false">Geometry</th></tr>
297 </thead>
298 <tfoot>
299 <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr>
300 </tfoot>
301 <tbody>
302 <tr><td>Student01</td><td>Languages</td><td>male</td><td>80</td><td>70</td><td>75</td><td>80</td></tr>
303 <tr><td>Student02</td><td>Mathematics</td><td>male</td><td>90</td><td>88</td><td>100</td><td>90</td></tr>
304 <tr><td>Student03</td><td>Languages</td><td>female</td><td>85</td><td>95</td><td>80</td><td>85</td></tr>
305 <tr><td>Student04</td><td>Languages</td><td>male</td><td>60</td><td>55</td><td>100</td><td>100</td></tr>
306 <tr><td>Student05</td><td>Languages</td><td>female</td><td>68</td><td>80</td><td>95</td><td>80</td></tr>
307 <tr><td>Student06</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
308 <tr><td>Student07</td><td>Mathematics</td><td>male</td><td>85</td><td>68</td><td>90</td><td>90</td></tr>
309 <tr><td>Student08</td><td>Languages</td><td>male</td><td>100</td><td>90</td><td>90</td><td>85</td></tr>
310 <tr><td>Student09</td><td>Mathematics</td><td>male</td><td>80</td><td>50</td><td>65</td><td>75</td></tr>
311 <tr><td>Student10</td><td>Languages</td><td>male</td><td>85</td><td>100</td><td>100</td><td>90</td></tr>
312 <tr><td>Student11</td><td>Languages</td><td>male</td><td>86</td><td>85</td><td>100</td><td>100</td></tr>
313 <tr><td>Student12</td><td>Mathematics</td><td>female</td><td>100</td><td>75</td><td>70</td><td>85</td></tr>
314 <tr><td>Student13</td><td>Languages</td><td>female</td><td>100</td><td>80</td><td>100</td><td>90</td></tr>
315 <tr><td>Student14</td><td>Languages</td><td>female</td><td>50</td><td>45</td><td>55</td><td>90</td></tr>
316 <tr><td>Student15</td><td>Languages</td><td>male</td><td>95</td><td>35</td><td>100</td><td>90</td></tr>
317 <tr><td>Student16</td><td>Languages</td><td>female</td><td>100</td><td>50</td><td>30</td><td>70</td></tr>
318 <tr><td>Student17</td><td>Languages</td><td>female</td><td>80</td><td>100</td><td>55</td><td>65</td></tr>
319 <tr><td>Student18</td><td>Mathematics</td><td>male</td><td>30</td><td>49</td><td>55</td><td>75</td></tr>
320 <tr><td>Student19</td><td>Languages</td><td>male</td><td>68</td><td>90</td><td>88</td><td>70</td></tr>
321 <tr><td>Student20</td><td>Mathematics</td><td>male</td><td>40</td><td>45</td><td>40</td><td>80</td></tr>
322 <tr><td>Student21</td><td>Languages</td><td>male</td><td>50</td><td>45</td><td>100</td><td>100</td></tr>
323 <tr><td>Student22</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
324 <tr><td>Student23</td><td>Languages</td><td>female</td><td>85</td><td>80</td><td>80</td><td>80</td></tr>
325 <tr><td>student23</td><td>Mathematics</td><td>male</td><td>82</td><td>77</td><td>0</td><td>79</td></tr>
326 <tr><td>student24</td><td>Languages</td><td>female</td><td>100</td><td>91</td><td>13</td><td>82</td></tr>
327 <tr><td>student25</td><td>Mathematics</td><td>male</td><td>22</td><td>96</td><td>82</td><td>53</td></tr>
328 <tr><td>student26</td><td>Languages</td><td>female</td><td>37</td><td>29</td><td>56</td><td>59</td></tr>
329 <tr><td>student27</td><td>Mathematics</td><td>male</td><td>86</td><td>82</td><td>69</td><td>23</td></tr>
330 <tr><td>student28</td><td>Languages</td><td>female</td><td>44</td><td>25</td><td>43</td><td>1</td></tr>
331 <tr><td>student29</td><td>Mathematics</td><td>male</td><td>77</td><td>47</td><td>22</td><td>38</td></tr>
332 <tr><td>student30</td><td>Languages</td><td>female</td><td>19</td><td>35</td><td>23</td><td>10</td></tr>
333 <tr><td>student31</td><td>Mathematics</td><td>male</td><td>90</td><td>27</td><td>17</td><td>50</td></tr>
334 <tr><td>student32</td><td>Languages</td><td>female</td><td>60</td><td>75</td><td>33</td><td>38</td></tr>
335 <tr><td>student33</td><td>Mathematics</td><td>male</td><td>4</td><td>31</td><td>37</td><td>15</td></tr>
336 <tr><td>student34</td><td>Languages</td><td>female</td><td>77</td><td>97</td><td>81</td><td>44</td></tr>
337 <tr><td>student35</td><td>Mathematics</td><td>male</td><td>5</td><td>81</td><td>51</td><td>95</td></tr>
338 <tr><td>student36</td><td>Languages</td><td>female</td><td>70</td><td>61</td><td>70</td><td>94</td></tr>
339 <tr><td>student37</td><td>Mathematics</td><td>male</td><td>60</td><td>3</td><td>61</td><td>84</td></tr>
340 <tr><td>student38</td><td>Languages</td><td>female</td><td>63</td><td>39</td><td>0</td><td>11</td></tr>
341 <tr><td>student39</td><td>Mathematics</td><td>male</td><td>50</td><td>46</td><td>32</td><td>38</td></tr>
342 <tr><td>student40</td><td>Languages</td><td>female</td><td>51</td><td>75</td><td>25</td><td>3</td></tr>
343 <tr><td>student41</td><td>Mathematics</td><td>male</td><td>43</td><td>34</td><td>28</td><td>78</td></tr>
344 <tr><td>student42</td><td>Languages</td><td>female</td><td>11</td><td>89</td><td>60</td><td>95</td></tr>
345 <tr><td>student43</td><td>Mathematics</td><td>male</td><td>48</td><td>92</td><td>18</td><td>88</td></tr>
346 <tr><td>student44</td><td>Languages</td><td>female</td><td>82</td><td>2</td><td>59</td><td>73</td></tr>
347 <tr><td>student45</td><td>Mathematics</td><td>male</td><td>91</td><td>73</td><td>37</td><td>39</td></tr>
348 <tr><td>student46</td><td>Languages</td><td>female</td><td>4</td><td>8</td><td>12</td><td>10</td></tr>
349 <tr><td>student47</td><td>Mathematics</td><td>male</td><td>89</td><td>10</td><td>6</td><td>11</td></tr>
350 <tr><td>student48</td><td>Languages</td><td>female</td><td>90</td><td>32</td><td>21</td><td>18</td></tr>
351 <tr><td>student49</td><td>Mathematics</td><td>male</td><td>42</td><td>49</td><td>49</td><td>72</td></tr>
352 <tr><td>student50</td><td>Languages</td><td>female</td><td>56</td><td>37</td><td>67</td><td>54</td></tr>
353 </tbody>
354 </table>
355 </div>
356
357 <br><br>
358
359 <h3>Attach sticky header to browser window</h3>
360 <table id="table1" class="tablesorter">
361 <caption>Student Grades</caption>
362 <thead>
363 <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th class="filter-false sorter-false">Geometry</th></tr>
364 </thead>
365 <tfoot>
366 <tr><th>Name</th><th>Major</th><th>Sex</th><th>English</th><th>Japanese</th><th>Calculus</th><th>Geometry</th></tr>
367 </tfoot>
368 <tbody>
369 <tr><td>Student01</td><td>Languages</td><td>male</td><td>80</td><td>70</td><td>75</td><td>80</td></tr>
370 <tr><td>Student02</td><td>Mathematics</td><td>male</td><td>90</td><td>88</td><td>100</td><td>90</td></tr>
371 <tr><td>Student03</td><td>Languages</td><td>female</td><td>85</td><td>95</td><td>80</td><td>85</td></tr>
372 <tr><td>Student04</td><td>Languages</td><td>male</td><td>60</td><td>55</td><td>100</td><td>100</td></tr>
373 <tr><td>Student05</td><td>Languages</td><td>female</td><td>68</td><td>80</td><td>95</td><td>80</td></tr>
374 <tr><td>Student06</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
375 <tr><td>Student07</td><td>Mathematics</td><td>male</td><td>85</td><td>68</td><td>90</td><td>90</td></tr>
376 <tr><td>Student08</td><td>Languages</td><td>male</td><td>100</td><td>90</td><td>90</td><td>85</td></tr>
377 <tr><td>Student09</td><td>Mathematics</td><td>male</td><td>80</td><td>50</td><td>65</td><td>75</td></tr>
378 <tr><td>Student10</td><td>Languages</td><td>male</td><td>85</td><td>100</td><td>100</td><td>90</td></tr>
379 <tr><td>Student11</td><td>Languages</td><td>male</td><td>86</td><td>85</td><td>100</td><td>100</td></tr>
380 <tr><td>Student12</td><td>Mathematics</td><td>female</td><td>100</td><td>75</td><td>70</td><td>85</td></tr>
381 <tr><td>Student13</td><td>Languages</td><td>female</td><td>100</td><td>80</td><td>100</td><td>90</td></tr>
382 <tr><td>Student14</td><td>Languages</td><td>female</td><td>50</td><td>45</td><td>55</td><td>90</td></tr>
383 <tr><td>Student15</td><td>Languages</td><td>male</td><td>95</td><td>35</td><td>100</td><td>90</td></tr>
384 <tr><td>Student16</td><td>Languages</td><td>female</td><td>100</td><td>50</td><td>30</td><td>70</td></tr>
385 <tr><td>Student17</td><td>Languages</td><td>female</td><td>80</td><td>100</td><td>55</td><td>65</td></tr>
386 <tr><td>Student18</td><td>Mathematics</td><td>male</td><td>30</td><td>49</td><td>55</td><td>75</td></tr>
387 <tr><td>Student19</td><td>Languages</td><td>male</td><td>68</td><td>90</td><td>88</td><td>70</td></tr>
388 <tr><td>Student20</td><td>Mathematics</td><td>male</td><td>40</td><td>45</td><td>40</td><td>80</td></tr>
389 <tr><td>Student21</td><td>Languages</td><td>male</td><td>50</td><td>45</td><td>100</td><td>100</td></tr>
390 <tr><td>Student22</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
391 <tr><td>Student23</td><td>Languages</td><td>female</td><td>85</td><td>80</td><td>80</td><td>80</td></tr>
392 <tr><td>student23</td><td>Mathematics</td><td>male</td><td>82</td><td>77</td><td>0</td><td>79</td></tr>
393 <tr><td>student24</td><td>Languages</td><td>female</td><td>100</td><td>91</td><td>13</td><td>82</td></tr>
394 <tr><td>student25</td><td>Mathematics</td><td>male</td><td>22</td><td>96</td><td>82</td><td>53</td></tr>
395 <tr><td>student26</td><td>Languages</td><td>female</td><td>37</td><td>29</td><td>56</td><td>59</td></tr>
396 <tr><td>student27</td><td>Mathematics</td><td>male</td><td>86</td><td>82</td><td>69</td><td>23</td></tr>
397 <tr><td>student28</td><td>Languages</td><td>female</td><td>44</td><td>25</td><td>43</td><td>1</td></tr>
398 <tr><td>student29</td><td>Mathematics</td><td>male</td><td>77</td><td>47</td><td>22</td><td>38</td></tr>
399 <tr><td>student30</td><td>Languages</td><td>female</td><td>19</td><td>35</td><td>23</td><td>10</td></tr>
400 <tr><td>student31</td><td>Mathematics</td><td>male</td><td>90</td><td>27</td><td>17</td><td>50</td></tr>
401 <tr><td>student32</td><td>Languages</td><td>female</td><td>60</td><td>75</td><td>33</td><td>38</td></tr>
402 <tr><td>student33</td><td>Mathematics</td><td>male</td><td>4</td><td>31</td><td>37</td><td>15</td></tr>
403 <tr><td>student34</td><td>Languages</td><td>female</td><td>77</td><td>97</td><td>81</td><td>44</td></tr>
404 <tr><td>student35</td><td>Mathematics</td><td>male</td><td>5</td><td>81</td><td>51</td><td>95</td></tr>
405 <tr><td>student36</td><td>Languages</td><td>female</td><td>70</td><td>61</td><td>70</td><td>94</td></tr>
406 <tr><td>student37</td><td>Mathematics</td><td>male</td><td>60</td><td>3</td><td>61</td><td>84</td></tr>
407 <tr><td>student38</td><td>Languages</td><td>female</td><td>63</td><td>39</td><td>0</td><td>11</td></tr>
408 <tr><td>student39</td><td>Mathematics</td><td>male</td><td>50</td><td>46</td><td>32</td><td>38</td></tr>
409 <tr><td>student40</td><td>Languages</td><td>female</td><td>51</td><td>75</td><td>25</td><td>3</td></tr>
410 <tr><td>student41</td><td>Mathematics</td><td>male</td><td>43</td><td>34</td><td>28</td><td>78</td></tr>
411 <tr><td>student42</td><td>Languages</td><td>female</td><td>11</td><td>89</td><td>60</td><td>95</td></tr>
412 <tr><td>student43</td><td>Mathematics</td><td>male</td><td>48</td><td>92</td><td>18</td><td>88</td></tr>
413 <tr><td>student44</td><td>Languages</td><td>female</td><td>82</td><td>2</td><td>59</td><td>73</td></tr>
414 <tr><td>student45</td><td>Mathematics</td><td>male</td><td>91</td><td>73</td><td>37</td><td>39</td></tr>
415 <tr><td>student46</td><td>Languages</td><td>female</td><td>4</td><td>8</td><td>12</td><td>10</td></tr>
416 <tr><td>student47</td><td>Mathematics</td><td>male</td><td>89</td><td>10</td><td>6</td><td>11</td></tr>
417 <tr><td>student48</td><td>Languages</td><td>female</td><td>90</td><td>32</td><td>21</td><td>18</td></tr>
418 <tr><td>student49</td><td>Mathematics</td><td>male</td><td>42</td><td>49</td><td>49</td><td>72</td></tr>
419 <tr><td>student50</td><td>Languages</td><td>female</td><td>56</td><td>37</td><td>67</td><td>54</td></tr>
420 </tbody>
421 </table>
422
423 <h3>Attach sticky header to its parent</h3>
424 <div class="narrow-block wrapper">
425 <table id="table2" class="tablesorter">
426 <caption>Student Grades</caption>
427 <thead>
428 <tr><th>Account #</th><th>First Name</th><th>Last Name</th><th>Age</th><th>Total</th><th>Discount</th><th>Diff</th></tr>
429 </thead>
430 <tbody>
431 <tr><td>A43</td><td>Peter</td><td>Parker</td><td>28</td><td>9.99</td><td>20.3%</td><td>+3</td></tr>
432 <tr><td>A255</td><td>John</td><td>Hood</td><td>33</td><td>19.99</td><td>25.1%</td><td>-7</td></tr>
433 <tr><td>A33</td><td>Clark</td><td>Kent</td><td>18</td><td>15.49</td><td>44.2%</td><td>-13</td></tr>
434 <tr><td>A11</td><td>Bruce</td><td>Almighty</td><td>45</td><td>153.19</td><td>44%</td><td>+19</td></tr>
435 <tr><td>A102</td><td>Bruce</td><td>Evans</td><td>56</td><td>153.19</td><td>23%</td><td>+9</td></tr>
436 <tr><td>A23</td><td>Mike</td><td>Peters</td><td>22</td><td>5.69</td><td>20.3%</td><td>+2</td></tr>
437 <tr><td>A55</td><td>Leslie</td><td>Kent</td><td>33</td><td>15.99</td><td>25.1%</td><td>-3</td></tr>
438 <tr><td>A3</td><td>Frank</td><td>Mint</td><td>44</td><td>12.59</td><td>44.2%</td><td>-12</td></tr>
439 <tr><td>A21</td><td>Joe</td><td>Thomas</td><td>45</td><td>15.25</td><td>44%</td><td>+12</td></tr>
440 <tr><td>A12</td><td>Tess</td><td>Evans</td><td>66</td><td>13.59</td><td>23%</td><td>+4</td></tr>
441 <tr><td>A21</td><td>Peter</td><td>Dunn</td><td>12</td><td>2.99</td><td>21.1%</td><td>+2</td></tr>
442 <tr><td>A33</td><td>Harry</td><td>Jones</td><td>13</td><td>19.49</td><td>22.2%</td><td>-6</td></tr>
443 <tr><td>A13</td><td>John</td><td>James</td><td>16</td><td>13.89</td><td>42.1%</td><td>-13</td></tr>
444 <tr><td>A71</td><td>Nick</td><td>Parker</td><td>45</td><td>13.89</td><td>44%</td><td>+29</td></tr>
445 <tr><td>A21</td><td>Charles</td><td>Dunn</td><td>19</td><td>15.49</td><td>22%</td><td>+3</td></tr>
446 </tbody>
447 </table>
448 </div>
449
450 <h3>Nested sticky header tables</h3>
451 <table id="table3" class="tablesorter">
452 <thead>
453 <tr>
454 <th>Main table header</th>
455 </tr>
456 </thead>
457 <tbody>
458 <tr>
459 <td>Main table - row 1</td>
460 </tr>
461 <tr>
462 <td>Main table - row 2</td>
463 </tr>
464 <tr>
465 <td>
466 Main table - row 3 (with nested table 1)
467 <table id="nested1" class="nested">
468 <thead>
469 <tr>
470 <th>Header for the nested table 1</th>
471 </tr>
472 <tr>
473 <th class="sorter-false">Second header row for nested table 1</th>
474 </tr>
475 </thead>
476 <tbody>
477 <tr><td>data in the nested table 1 - row 1</td></tr>
478 <tr><td>data in the nested table 1 - row 2</td></tr>
479 <tr><td>data in the nested table 1 - row 3</td></tr>
480 <tr><td>data in the nested table 1 - row 4</td></tr>
481 <tr><td>data in the nested table 1 - row 5</td></tr>
482 <tr>
483 <td>
484 data in the nested table 1 - row 6 (with nested table 2)
485 <table id="nested2" class="nested">
486 <caption class="dark-row">Nested table 2 caption</caption>
487 <thead>
488 <tr>
489 <th>Header for the nested table 2</th>
490 </tr>
491 <tr>
492 <th class="sorter-false">Second header row for nested table 2</th>
493 </tr>
494 </thead>
495 <tbody>
496 <tr><td>data in the nested table 2 - row 1</td></tr>
497 <tr><td>data in the nested table 2 - row 2</td></tr>
498 <tr><td>data in the nested table 2 - row 3</td></tr>
499 <tr><td>data in the nested table 2 - row 4</td></tr>
500 <tr><td>data in the nested table 2 - row 5</td></tr>
501 <tr><td>data in the nested table 2 - row 6</td></tr>
502 <tr><td>data in the nested table 2 - row 7</td></tr>
503 <tr><td>data in the nested table 2 - row 8</td></tr>
504 <tr><td>data in the nested table 2 - row 9</td></tr>
505 <tr><td>data in the nested table 2 - row 10</td></tr>
506 <tr><td>data in the nested table 2 - row 11</td></tr>
507 <tr><td>data in the nested table 2 - row 12</td></tr>
508 <tr><td>data in the nested table 2 - row 13</td></tr>
509 <tr><td>data in the nested table 2 - row 14</td></tr>
510 <tr><td>data in the nested table 2 - row 15</td></tr>
511 <tr><td>data in the nested table 2 - row 16</td></tr>
512 <tr><td>data in the nested table 2 - row 17</td></tr>
513 <tr><td>data in the nested table 2 - row 18</td></tr>
514 <tr><td>data in the nested table 2 - row 19</td></tr>
515 <tr><td>data in the nested table 2 - row 20</td></tr>
516 </tbody>
517 </table>
518 </td>
519 </tr>
520 <tr><td>data in the nested table 1 - row 7</td></tr>
521 <tr><td>data in the nested table 1 - row 8</td></tr>
522 <tr><td>data in the nested table 1 - row 9</td></tr>
523 <tr><td>data in the nested table 1 - row 10</td></tr>
524 <tr><td>data in the nested table 1 - row 11</td></tr>
525 <tr><td>data in the nested table 1 - row 12</td></tr>
526 <tr><td>data in the nested table 1 - row 13</td></tr>
527 <tr><td>data in the nested table 1 - row 14</td></tr>
528 <tr><td>data in the nested table 1 - row 15</td></tr>
529 <tr><td>data in the nested table 1 - row 16</td></tr>
530 <tr><td>data in the nested table 1 - row 17</td></tr>
531 <tr><td>data in the nested table 1 - row 18</td></tr>
532 <tr><td>data in the nested table 1 - row 19</td></tr>
533 <tr><td>data in the nested table 1 - row 20</td></tr>
534 <tr><td>data in the nested table 1 - row 21</td></tr>
535 </tbody>
536 </table>
537 </td>
538 </tr>
539 <tr>
540 <td>Main table - row 4</td>
541 </tr>
542 <tr>
543 <td>
544 Main table - row 5 (with nested table 3)
545 <table id="nested3" class="nested">
546 <caption class="dark-row">Nested table 3 caption</caption>
547 <thead>
548 <tr>
549 <th>Header for the nested table 3</th>
550 </tr>
551 </thead>
552 <tbody>
553 <tr><td>data in the nested table 3 - row 1</td></tr>
554 <tr><td>data in the nested table 3 - row 2</td></tr>
555 <tr><td>data in the nested table 3 - row 3</td></tr>
556 <tr><td>data in the nested table 3 - row 4</td></tr>
557 <tr><td>data in the nested table 3 - row 5</td></tr>
558 <tr><td>data in the nested table 3 - row 6</td></tr>
559 <tr><td>data in the nested table 3 - row 7</td></tr>
560 <tr><td>data in the nested table 3 - row 8</td></tr>
561 <tr><td>data in the nested table 3 - row 9</td></tr>
562 <tr><td>data in the nested table 3 - row 10</td></tr>
563 <tr><td>data in the nested table 3 - row 11</td></tr>
564 <tr><td>data in the nested table 3 - row 12</td></tr>
565 <tr><td>data in the nested table 3 - row 13</td></tr>
566 <tr><td>data in the nested table 3 - row 14</td></tr>
567 <tr><td>data in the nested table 3 - row 15</td></tr>
568 <tr><td>data in the nested table 3 - row 16</td></tr>
569 <tr><td>data in the nested table 3 - row 17</td></tr>
570 <tr><td>data in the nested table 3 - row 18</td></tr>
571 <tr><td>data in the nested table 3 - row 19</td></tr>
572 <tr><td>data in the nested table 3 - row 20</td></tr>
573 </tbody>
574 </table>
575 </td>
576 </tr>
577 <tr>
578 <td>Main table - row 6</td>
579 </tr>
580 </tbody>
581 </table>
582
583 <div class="spacer"></div>
584 </div>
585
586 </body>
587 </html>