Debian Codegraph @

docs/example-widget-sort-to-hash.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery tablesorter 2.0 - Sort2Hash Widget (Beta)</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/jq.css">
14 <link href="css/prettify.css" rel="stylesheet">
15 <script src="js/prettify.js"></script>
16 <script src="js/docs.js"></script>
17
18 <!-- Tablesorter: required -->
19 <link rel="stylesheet" href="../css/theme.blue.css">
20 <script src="../js/jquery.tablesorter.js"></script>
21 <script src="../js/jquery.tablesorter.widgets.js"></script>
22 <script src="../js/widgets/widget-sort2Hash.js"></script>
23
24 <link rel="stylesheet" href="../addons/pager/jquery.tablesorter.pager.css">
25 <script src="../js/widgets/widget-pager.js"></script>
26
27 <script id="js">$(function() {
28
29 $( 'table' ).tablesorter({
30 theme: 'blue',
31 widgets: [ 'zebra', 'sort2Hash', 'filter' ],
32 widgetOptions : {
33 // hash prefix
34 sort2Hash_hash : '#',
35 // don't '#' or '=' here
36 sort2Hash_separator : ',',
37 // this option > table ID > table index on page
38 sort2Hash_tableId : null,
39 // data attribute containing alternate header text
40 sort2Hash_headerTextAttr : 'data-header',
41 // direction text shown in the URL e.g. [ 'asc', 'desc' ]
42 sort2Hash_directionText : [ 0, 1 ], // default values
43 // if true, override saveSort widget sort, if used & stored sort is available
44 sort2Hash_overrideSaveSort : true, // default = false
45 // if true, hash changes are not saved to browser history
46 sort2Hash_replaceHistory : false,
47
48 sort2Hash_encodeHash : null,
49 /* how to use encodeHash
50 sort2Hash_encodeHash : function( config, tableId, component, value, rawValue ) {
51 // config = table.config settings
52 // tableId = processed table ID
53 // component: 'sort', 'page', 'size' or 'filter'
54 // value = string value that has encodeURIComponent applied
55 // rawValue = value ( array or number )
56 // return false to let the widget encode the string
57 return '&' + component + '[' + tableId + ']=' + value;
58 },
59 */
60 sort2Hash_decodeHash : null,
61 /*
62 sort2Hash_decodeHash : function( config, tableId, component ) {
63 // config = table.config settings
64 // tableId = processed table ID
65 // component: 'sort', 'page', 'size' or 'filter'
66 // return false to let the widget decode the hash
67
68 // $.tablesorter.sort2Hash.getParam( parameter, url ); function added in v2.24.4
69 // parameter = desired parameter to extract
70 // url (optional) = hash or href string to extract the parameter value from
71 return $.tablesorter.sort2Hash.getParam( component + '[' + tableId + ']' ) || '';
72 }
73 */
74 sort2Hash_cleanHash : null,
75 /*
76 sort2Hash_cleanHash : function( config, tableId, component, hash ) {
77 // config = table.config settings
78 // tableId = processed table ID
79 // component: 'sort', 'page', 'size' or 'filter'
80 // return false to let the widget decode the hash
81
82 // removeParam function added v2.24.4
83 return $.tablesorter.sort2Hash.removeParam( component + '[' + tableId + ']' );
84 }
85 */
86 pager_output : '{startRow:input} to {endRow} ({filteredRows})',
87 pager_size : 2
88 }
89 });
90
91 });</script>
92 </head>
93 <body>
94 <div id="banner">
95 <h1>table<em>sorter</em></h1>
96 <h2>Sort2Hash Widget (Beta)</h2>
97 <h3>Flexible client-side table sorting</h3>
98 <a href="index.html">Back to documentation</a>
99 </div>
100 <div id="main">
101
102 <p></p>
103 <br>
104
105 <div id="root" class="accordion">
106
107 <h3><a href="#">Notes</a></h3>
108 <div>
109 <ul>
110 <li>In <span class="version">v2.24.4</span>,
111 <ul>
112 <li>Added a <code>getParam</code> (get URL parameter) &amp; a <code>removeParam</code> utility function to help deal with parameters in the URL hash. See the "Functions" section below for more details.</li>
113 <li><a href="https://github.com/alexweissman">Alex Weissman</a> has also provided code for a custom hash transformation in <a href="https://gist.github.com/alexweissman/04eebe93706d3c64d89b">this gist</a>; this code sets hash parameters that include the table id &amp; named columns, e.g. <code>&filter[table0][first_name]=foobar</code>.</li>
114 </ul>
115 </li>
116 <li>In <span class="version">v2.24.0</span>, lots of changes were made:
117 <ul>
118 <li>Removed <code class="alert">sort2Hash_useHeaderText</code> and <code class="alert">sort2Hash_processHeaderText</code> options.</li>
119 <li>Added <code>sort2Hash_headerTextAttr</code> option to replace the above two options.</li>
120 <li>Added <code>sort2Hash_encodeHash</code>, <code>sort2Hash_decodeHash</code> and <code>sort2Hash_cleanHash</code> options to allow custom value to hash processing.</li>
121 <li>This widget now works with the pager &amp; filter, so the hash now includes pager current page, pager page size and current filters in the hash.</li>
122 <li>Lots of internal tweaks.</li>
123 </ul>
124 </li>
125 <li>Added <span class="version">v2.22.4</span>. Instead of using the <a href="example-widget-savesort.html">saveSort</a> widget, this widget updates the hash tag to allow saving &amp; sharing a sort applied to a tablesorter table.</li>
126 <li>Sort the tables in the demo below. Notice the changes made to the location hash, then reload the page to have the hash applied to the tables.</li>
127 <li>This widget requires jQuery version 1.7+.</li>
128 <li>This widget does NOT work with tablesorter v2.0.5.</li>
129 </ul>
130 </div>
131
132 <h3><a href="#">Options</a></h3>
133 <div>
134 <h3>Sort2Hash widget default options (added inside of tablesorter <code>widgetOptions</code>)</h3>
135 <div class="tip">
136 <span class="label label-info">TIP!</span> Click on the link in the option 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.
137 </div>
138 <table class="tablesorter-blue options">
139 <thead>
140 <tr><th>Option</th><th>Default</th><th class="sorter-false">Description</th></tr>
141 </thead>
142 <tbody>
143
144 <tr id="sort2hash_hash">
145 <td><span class="permalink">sort2hash_hash</span></td>
146 <td><code>'#'</code></td>
147 <td>
148 The hash should always be there. This option was added to allow setting extra hash parameters and/or hashbang or whatever.
149 </td>
150 </tr>
151
152 <tr id="sort2hash_separator">
153 <td><a href="#" class="permalink">sort2Hash_separator</a></td>
154 <td><code>','</code></td>
155 <td>
156 Change the hash separator using this option. There are some limitations.
157 <div class="collapsible">
158 <br>
159 In the location hash, the sort parameters are added as <code>&tableID=column,direction, ... ,column,direction</code> (no spaces). This option allows changing the column-direction separator, a comma by default, into the chosen separator.
160 <p><span class="label alert">*NOTE*</span> Do not set this option to use a hash (<code>#</code>), ampersand (<code>&</code>) or equal sign (<code>=</code>) as it will interfere with how the hash parameters are set up.</p>
161 </div>
162 </td>
163 </tr>
164
165 <tr id="sort2hash_tableid">
166 <td><a href="#" class="permalink">sort2Hash_tableId</a></td>
167 <td><code>null</code></td>
168 <td>
169 Set an ID here to override the table id attribute.
170 <div class="collapsible">
171 <br>
172 In the location hash, the sort parameters are added as <code>&tableID=column,direction, ... ,column,direction</code> (no spaces). The <code>tableID</code> is set by this option.
173 <p>This option setting is prioritized over the actual table ID attribute. If neither are set, the <code>tableID</code> will be set as the table's zero-based index on the page.</p>
174 <pre class="prettyprint">sort2Hash_tableID &gt; table.id attribute &gt; table index</pre>
175 </div>
176 </td>
177 </tr>
178
179 <tr id="sort2hash_headertextattr">
180 <td><a href="#" class="permalink">sort2Hash_headerTextAttr</a></td>
181 <td><code>'data-header'</code></td>
182 <td>
183 Data attribute on header cell containing alternate column identifier added to location hash.
184 <div class="collapsible">
185 <br>
186 This option replaces both <code>sort2Hash_useHeaderText</code> and <code>sort2Hash_processHeaderText</code> options.
187 <p>The contents of this attribute will be used in the hash to identify a sorted column.</p>
188 <p>Use the header attribute as follows:</p>
189 <pre class="prettyprint lang-js">&lt;th data-header="first"&gt;First Name&lt;/th&gt;</pre>
190 </div>
191 </td>
192 </tr>
193
194 <tr id="sort2hash_directiontext">
195 <td><a href="#" class="permalink">sort2Hash_directionText</a></td>
196 <td><code>[ 0, 1 ]</code></td>
197 <td>
198 Set the direction text shown in the URL.
199 <div class="collapsible">
200 <br>
201 Only the first two values will be used from this array. The first value is assigned to ascending sorts and the second is assigned to descending sorts.
202 <p>Use the option as follows:</p>
203 <pre class="prettyprint lang-js">sort2Hash_directionText : [ 'asc', 'desc' ]</pre>
204 <span class="label warning">*NOTE*</span> When converting the hash into a value, if the direction hash does not match the second value (<code>'desc'</code> in the example above), it will fallback to an ascending sort no matter what text in contained within the first value.
205 </div>
206 </td>
207 </tr>
208
209 <tr id="sort2hash_overridesavesort">
210 <td><span class="permalink">sort2Hash_overrideSaveSort</span></td>
211 <td><code>false</code></td>
212 <td>if <code>true</code>, the hash sort will override any stored sort (saveSort widget).</td>
213 </tr>
214
215 <tr id="sort2hash_replacehistory">
216 <td><a href="#" class="permalink">sort2Hash_replaceHistory</a></td>
217 <td><code>false</code></td>
218 <td>Change how the browser history is managed (<span class="version">v2.29.0</span>)
219 <div class="collapsible">
220 <p>If <code>true</code>, all hash changes are not saved to browser history, so when the user presses the back arrow, they will be returned to the previous page.</p>
221 If <code>false</code>, all hash changes are preserved in the browser history, so when the user presses the back arrow, the hash will show the previous state, but the table won't update unless the page is refreshed.
222 </div>
223 </td>
224 </tr>
225
226 <tr id="sort2hash_encodehash">
227 <td><a href="#" class="permalink">sort2Hash_encodeHash</a></td>
228 <td><code>null</code></td>
229 <td>
230 Add a function to create a custom hash (<span class="version updated">v2.24.4</span>).
231 <div class="collapsible">
232 <br>
233 The following example is a duplicate of the internal code that encodes the hash. Adapt to fit your needs:
234 <pre class="prettyprint lang-js">sort2Hash_encodeHash : function( config, tableId, component, value, rawValue ) {
235 // config = table.config settings
236 // tableId = processed table ID
237 // component: 'sort', 'page', 'size' or 'filter'
238 // value = string value that has encodeURIComponent applied
239 // rawValue = value ( array or number )
240 // return false to let the widget encode the string
241 return '&' + component + '[' + tableId + ']=' + value;
242 }</pre>
243 Return a string to add to the <code>window.location.hash</code> directly.
244 <p>If this function returns <code>false</code>, then the internal code will encode the hash for that component. This was done in case only one parameter needs special handling:</p>
245 <pre class="prettyprint lang-js">sort2Hash_encodeHash : function( config, tableId, component, value, rawValue ) {
246 // only the filter gets special handling
247 if ( component === 'filter' ) {
248 // if working with rawValue, make sure to use
249 // encodeURIComponent on the results
250 var newValue = encodeURIComponent( rawValue.join( '--' ) );
251 return tableId + 'filter=' + newValue;
252 }
253 return false;
254 }</pre>
255 </div>
256 </td>
257 </tr>
258
259 <tr id="sort2hash_decodehash">
260 <td><a href="#" class="permalink">sort2Hash_decodeHash</a></td>
261 <td><code>null</code></td>
262 <td>
263 Add a function to process a custom hash (<span class="version updated">v2.24.4</span>).
264 <div class="collapsible">
265 <br>
266 The following example is a duplicate of the internal code that decodes the hash. Adapt to fit your needs:
267 <pre class="prettyprint lang-js">sort2Hash_decodeHash : function( config, tableId, component ) {
268 // config = table.config settings
269 // tableId = processed table ID
270 // component: 'sort', 'page', 'size' or 'filter'
271 // return false to let the widget decode the hash
272
273 // $.tablesorter.sort2Hash.getParam( parameter, url ); function added in v2.24.4
274 // parameter = desired parameter to extract
275 // url (optional) = hash or href string to extract the parameter value from
276 return $.tablesorter.sort2Hash.getParam( component + '[' + tableId + ']' ) || '';
277 }</pre>
278 Return the component value or an empty string.
279 <p>If this function returns <code>false</code>, then the internal code will attempt to decode the hash for that component. This was done in case only one parameter needs special handling:</p>
280 <pre class="prettyprint lang-js">sort2Hash_decodeHash : function( config, tableId, component ) {
281 // only the filter gets special handling
282 if ( component === 'filter' ) {
283 return $.tablesorter.sort2Hash.getParam( tableId + 'filter' ) || '';
284 }
285 return false;
286 }</pre>
287 </div>
288 </td>
289 </tr>
290
291 <tr id="sort2hash_cleanhash">
292 <td><a href="#" class="permalink">sort2Hash_cleanHash</a></td>
293 <td><code>null</code></td>
294 <td>
295 Add a function to remove a custom hash (<span class="version updated">v2.24.4</span>).
296 <div class="collapsible">
297 <br>
298 The following example is a duplicate of the internal code that removes unused values in the hash. Adapt to fit your needs:
299 <pre class="prettyprint lang-js">sort2Hash_cleanHash : function( config, tableId, component, hash ) {
300 // removeParam function added v2.24.4
301 return $.tablesorter.sort2Hash.removeParam( component + '[' + tableId + ']' );
302 }</pre>
303 Return a string of the remaining components or an empty string.
304 <p>If this function returns <code>false</code>, then the internal code will attempt to clean the hash for that component. This was done in case only one parameter needs special handling:</p>
305 <pre class="prettyprint lang-js">sort2Hash_cleanHash : function( config, tableId, component, hash ) {
306 // config = table.config settings
307 // tableId = processed table ID
308 // component: 'sort', 'page', 'size' or 'filter'
309 // return false to let the widget decode the hash
310
311 if ( component === 'filter' ) {
312 // removeParam function added v2.24.4
313 return $.tablesorter.sort2Hash.removeParam( tableId + 'filter' );
314 /* ORIGINAL METHOD, use if the "getParam" function doesn't work on your custom parameter
315 var index,
316 result = [],
317 // regular expression to match the component & value
318 regex = new RegExp( tableId + 'filter=([^&]*)' );
319 // split hash into component parts
320 parts = ( hash || '' ).slice(1).split( '&' ),
321 len = parts.length;
322 // cycle through each component part
323 for ( index = 0; index < len; index++ ) {
324 // if the component doesn't match the regular expression...
325 if ( !regex.test( parts[ index ] ) ) {
326 // then save it
327 result.push( parts[ index ] );
328 }
329 }
330 // if we still have something left, join the components back together
331 // and return it so the next component can be processed
332 // we don't update the window.location.hash, or the page jumps to the top!
333 return result.length ? c.widgetOptions.sort2Hash_hash + result.join( '&' ) : '';
334 */
335 }
336 return false;
337 }</pre>
338 </div>
339 </td>
340 </tr>
341
342 </tbody>
343
344 <!-- non-sorting tbody -->
345 <tbody id="deprecated" class="tablesorter-infoOnly">
346 <tr><th colspan="5">Deprecated/Removed Options</th></tr>
347 </tbody>
348
349 <tbody>
350 <tr id="sort2hash_useheadertext">
351 <td><a href="#" class="permalink alert">sort2Hash_useHeaderText</a></td>
352 <td><code>false</code></td>
353 <td>
354 This option has been <span class="label alert">removed</span> in v2.24.0! It has been replaced by <a href="#"><code>sort2Hash_headerTextAttr</code></a>.
355 <div class="collapsible">
356 <p>If <code>true</code>, text from the header is used instead of a zero-based column index.</p>
357 Please be aware that if the column text contains spaces or special characters, they will be encoded in the URL. So, <code>"First &#xa3;$&#x20ac;&#x00a4;&#x00a5;&#xa2; Name"</code> will become <code>"First%20%C2%A3$%E2%82%AC%C2%A4%C2%A5%C2%A2%20Name"</code>. This would make the hash very difficult to read.
358 <p>Further processing of this header cell text can be done using the <code>sort2Hash_processHeaderText</code> function.</p>
359 </div>
360 </td>
361 </tr>
362
363 <tr id="sort2hash_processheadertext">
364 <td><a href="#" class="permalink alert">sort2Hash_processHeaderText</a></td>
365 <td><code>null</code></td>
366 <td>
367 This option has been <span class="label alert">removed</span> in v2.24.0! It has been replaced by <a href="#"><code>sort2Hash_headerTextAttr</code></a>.
368 <div class="collapsible">
369 <p>If the <code>sort2Hash_useHeaderText</code> option is <code>true</code>, a function here will further process the header cell text.</p>
370 Use this function to perform any processing on the header cell text, as desired.
371 <p>At this point, the header cell text has not been encoded.</p>
372 <p>Here is one example:</p>
373 <pre class="prettyprint lang-js">sort2Hash_processHeaderText : function( text, config, columnIndex ) {
374 // remove all non-alphanumeric characters (including spaces)
375 return text.replace( /[^a-z0-9]/gi, '' );
376 }</pre>
377 Another example:
378 <pre class="prettyprint lang-js">sort2Hash_processHeaderText : function( text, config, columnIndex ) {
379 // completely custom text to use for the hash
380 // this method assumes that the table layout is constant
381 // (i.e. columns are not added, removed or rearranged)
382 return [ 'first', 'last', 'age', 'total', 'disc', 'date' ][ columnIndex ];
383 }</pre>
384 </div>
385 </td>
386 </tr>
387 </tbody>
388
389 </table>
390 </div>
391
392 <h3><a href="#">Functions</a></h3>
393 <div>
394 <h3>Sort2Hash utility functions (added to <code>$.tablesorter.sort2Hash</code>)</h3>
395 <div class="tip">
396 <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.
397 </div>
398 <table class="tablesorter-blue options">
399 <thead>
400 <tr><th>Function</th><th class="sorter-false">Description</th></tr>
401 </thead>
402 <tbody>
403
404 <tr id="getparam">
405 <td><a href="#" class="permalink">getParam</a></td>
406 <td>
407 Get URL Parameter (getParam) function
408 <div class="collapsible">
409 <p>This function will extract the value of the name passed to the function. Use it as follows:</p>
410 <pre class="prettyprint lang-js">// $.tablesorter.sort2Hash.getParam( name, hash );
411 // name = parameter name (key)
412 // hash = (optional) if undefined, it will get the string value from window.location.hash
413 var hash = '&sort[table-users][user_name]=asc&page[table-users]=1&size[table-users]=10&filter[table-users][user_name]=ad',
414 result = $.tablesorter.sort2Hash.getParam( 'filter[table-users][user_name]', hash );
415 // result = "ad";</pre>
416 </div>
417 </td>
418 </tr>
419
420 <tr id="removeparam">
421 <td><a href="#" class="permalink">removeParam</a></td>
422 <td>
423 Remove parameter from hash
424 <div class="collapsible">
425 <p>This function will remove the key &amp; value from the passed hash. Use it as follows:</p>
426 <pre class="prettyprint lang-js">// $.tablesorter.sort2Hash.removeParam( name, hash );
427 // name = parameter name (key)
428 // hash = (optional) if undefined, it will get the string value from window.location.hash
429 var hash = '&sort[table-users][user_name]=asc&page[table-users]=1&size[table-users]=10&filter[table-users][user_name]=ad',
430 result = $.tablesorter.sort2Hash.removeParam( 'filter[table-users][user_name]', hash );
431 // result = "&sort[table-users][user_name]=asc&page[table-users]=1&size[table-users]=10";</pre>
432 <span class="label warning">*NOTE*</span> This function does not update <code>window.location.hash</code>.
433 </div>
434 </td>
435 </tr>
436 </tbody>
437 </table>
438 </div>
439
440 </div>
441
442 <h1>Demo</h1>
443 <div id="demo"><h3>Basic Usage <sup class="results">&dagger;</sup></h3>
444 <table>
445 <thead>
446 <tr>
447 <th>First Name</th>
448 <th>Last Name</th>
449 <th>Age</th>
450 <th>Total</th>
451 <th>Discount</th>
452 <th>Date</th>
453 </tr>
454 </thead>
455 <tbody>
456 <tr><td>Peter</td><td>Parker</td><td>28</td><td>$9.99</td><td>20%</td><td>Jul 6, 2006 8:14 AM</td></tr>
457 <tr><td>John</td><td>Hood</td><td>33</td><td>$19.99</td><td>25%</td><td>Dec 10, 2002 5:14 AM</td></tr>
458 <tr><td>Clark</td><td>Kent</td><td>18</td><td>$15.89</td><td>44%</td><td>Jan 12, 2003 11:14 AM</td></tr>
459 <tr><td>Bruce</td><td>Almighty</td><td>45</td><td>$153.19</td><td>44%</td><td>Jan 18, 2001 9:12 AM</td></tr>
460 <tr><td>Bruce</td><td>Evans</td><td>22</td><td>$13.19</td><td>11%</td><td>Jan 18, 2007 9:12 AM</td></tr>
461 </tbody>
462 </table>
463 <span class="results">&dagger;</span> <span class="xsmall">This table shows up as "table4" because there is no ID assigned, and it is the fifth table (zero-based index) on the page. The first table is in the "Options" section. The second is actually the stickyheader table for "Options". The third & forth (sticky header) are in the "Functions" section.</span>
464
465 <h3>Data Header (Using symbols for headers)</h3>
466 <table id="second">
467 <thead>
468 <tr>
469 <th data-header="^">First Name (^)</th>
470 <th data-header="&">Last Name (&)</th>
471 <th data-header="#">Age (#)</th>
472 <th data-header="$">Total ($)</th>
473 <th data-header="%">Discount (%)</th>
474 <th data-header="*">Date (*)</th>
475 </tr>
476 </thead>
477 <tbody>
478 <tr><td>Peter</td><td>Parker</td><td>28</td><td>$9.99</td><td>20%</td><td>Jul 6, 2006 8:14 AM</td></tr>
479 <tr><td>John</td><td>Hood</td><td>33</td><td>$19.99</td><td>25%</td><td>Dec 10, 2002 5:14 AM</td></tr>
480 <tr><td>Clark</td><td>Kent</td><td>18</td><td>$15.89</td><td>44%</td><td>Jan 12, 2003 11:14 AM</td></tr>
481 <tr><td>Bruce</td><td>Almighty</td><td>45</td><td>$153.19</td><td>44%</td><td>Jan 18, 2001 9:12 AM</td></tr>
482 <tr><td>Bruce</td><td>Evans</td><td>22</td><td>$13.19</td><td>11%</td><td>Jan 18, 2007 9:12 AM</td></tr>
483 </tbody>
484 </table>
485
486 <hr>
487 <h3>Pager (page &amp; size)</h3>
488 <div class="pager">
489 <img src="../addons/pager/icons/first.png" class="first" alt="First" />
490 <img src="../addons/pager/icons/prev.png" class="prev" alt="Prev" />
491 <span class="pagedisplay"></span> <!-- this can be any element, including an input -->
492 <img src="../addons/pager/icons/next.png" class="next" alt="Next" />
493 <img src="../addons/pager/icons/last.png" class="last" alt="Last" />
494 <select class="pagesize" title="Select page size">
495 <option value="10">10</option>
496 <option value="20">20</option>
497 <option value="30">30</option>
498 <option value="all">All rows</option>
499 </select>
500 <select class="gotoPage" title="Select page number"></select>
501 </div>
502 <table id="third" class="widget-pager">
503 <thead>
504 <tr>
505 <th data-header="name">Name</th>
506 <th data-header="major">Major</th>
507 <th data-header="gender">Sex</th>
508 <th data-header="english">English</th>
509 <th data-header="japanese">Japanese</th>
510 <th data-header="calculus">Calculus</th>
511 <th data-header="geometry">Geometry</th>
512 </tr>
513 </thead>
514 <tfoot>
515 <tr>
516 <th>Name</th>
517 <th>Major</th>
518 <th>Sex</th>
519 <th>English</th>
520 <th>Japanese</th>
521 <th>Calculus</th>
522 <th>Geometry</th>
523 </tr>
524 </tfoot>
525 <tbody>
526 <tr><td>Student01</td><td>Languages</td><td>male</td><td>80</td><td>70</td><td>75</td><td>80</td></tr>
527 <tr><td>Student02</td><td>Mathematics</td><td>male</td><td>90</td><td>88</td><td>100</td><td>90</td></tr>
528 <tr><td>Student03</td><td>Languages</td><td>female</td><td>85</td><td>95</td><td>80</td><td>85</td></tr>
529 <tr><td>Student04</td><td>Languages</td><td>male</td><td>60</td><td>55</td><td>100</td><td>100</td></tr>
530 <tr><td>Student05</td><td>Languages</td><td>female</td><td>68</td><td>80</td><td>95</td><td>80</td></tr>
531 <tr><td>Student06</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
532 <tr><td>Student07</td><td>Mathematics</td><td>male</td><td>85</td><td>68</td><td>90</td><td>90</td></tr>
533 <tr><td>Student08</td><td>Languages</td><td>male</td><td>100</td><td>90</td><td>90</td><td>85</td></tr>
534 <tr><td>Student09</td><td>Mathematics</td><td>male</td><td>80</td><td>50</td><td>65</td><td>75</td></tr>
535 <tr><td>Student10</td><td>Languages</td><td>male</td><td>85</td><td>100</td><td>100</td><td>90</td></tr>
536 <tr><td>Student11</td><td>Languages</td><td>male</td><td>86</td><td>85</td><td>100</td><td>100</td></tr>
537 <tr><td>Student12</td><td>Mathematics</td><td>female</td><td>100</td><td>75</td><td>70</td><td>85</td></tr>
538 <tr><td>Student13</td><td>Languages</td><td>female</td><td>100</td><td>80</td><td>100</td><td>90</td></tr>
539 <tr><td>Student14</td><td>Languages</td><td>female</td><td>50</td><td>45</td><td>55</td><td>90</td></tr>
540 <tr><td>Student15</td><td>Languages</td><td>male</td><td>95</td><td>35</td><td>100</td><td>90</td></tr>
541 <tr><td>Student16</td><td>Languages</td><td>female</td><td>100</td><td>50</td><td>30</td><td>70</td></tr>
542 <tr><td>Student17</td><td>Languages</td><td>female</td><td>80</td><td>100</td><td>55</td><td>65</td></tr>
543 <tr><td>Student18</td><td>Mathematics</td><td>male</td><td>30</td><td>49</td><td>55</td><td>75</td></tr>
544 <tr><td>Student19</td><td>Languages</td><td>male</td><td>68</td><td>90</td><td>88</td><td>70</td></tr>
545 <tr><td>Student20</td><td>Mathematics</td><td>male</td><td>40</td><td>45</td><td>40</td><td>80</td></tr>
546 <tr><td>Student21</td><td>Languages</td><td>male</td><td>50</td><td>45</td><td>100</td><td>100</td></tr>
547 <tr><td>Student22</td><td>Mathematics</td><td>male</td><td>100</td><td>99</td><td>100</td><td>90</td></tr>
548 <tr><td>Student23</td><td>Mathematics</td><td>male</td><td>82</td><td>77</td><td>0</td><td>79</td></tr>
549 <tr><td>Student24</td><td>Languages</td><td>female</td><td>100</td><td>91</td><td>13</td><td>82</td></tr>
550 <tr><td>Student25</td><td>Mathematics</td><td>male</td><td>22</td><td>96</td><td>82</td><td>53</td></tr>
551 <tr><td>Student26</td><td>Languages</td><td>female</td><td>37</td><td>29</td><td>56</td><td>59</td></tr>
552 <tr><td>Student27</td><td>Mathematics</td><td>male</td><td>86</td><td>82</td><td>69</td><td>23</td></tr>
553 <tr><td>Student28</td><td>Languages</td><td>female</td><td>44</td><td>25</td><td>43</td><td>1</td></tr>
554 <tr><td>Student29</td><td>Mathematics</td><td>male</td><td>77</td><td>47</td><td>22</td><td>38</td></tr>
555 <tr><td>Student30</td><td>Languages</td><td>female</td><td>19</td><td>35</td><td>23</td><td>10</td></tr>
556 <tr><td>Student31</td><td>Mathematics</td><td>male</td><td>90</td><td>27</td><td>17</td><td>50</td></tr>
557 <tr><td>Student32</td><td>Languages</td><td>female</td><td>60</td><td>75</td><td>33</td><td>38</td></tr>
558 <tr><td>Student33</td><td>Mathematics</td><td>male</td><td>4</td><td>31</td><td>37</td><td>15</td></tr>
559 <tr><td>Student34</td><td>Languages</td><td>female</td><td>77</td><td>97</td><td>81</td><td>44</td></tr>
560 <tr><td>Student35</td><td>Mathematics</td><td>male</td><td>5</td><td>81</td><td>51</td><td>95</td></tr>
561 <tr><td>Student36</td><td>Languages</td><td>female</td><td>70</td><td>61</td><td>70</td><td>94</td></tr>
562 <tr><td>Student37</td><td>Mathematics</td><td>male</td><td>60</td><td>3</td><td>61</td><td>84</td></tr>
563 <tr><td>Student38</td><td>Languages</td><td>female</td><td>63</td><td>39</td><td>0</td><td>11</td></tr>
564 <tr><td>Student39</td><td>Mathematics</td><td>male</td><td>50</td><td>46</td><td>32</td><td>38</td></tr>
565 <tr><td>Student40</td><td>Languages</td><td>female</td><td>51</td><td>75</td><td>25</td><td>3</td></tr>
566 <tr><td>Student41</td><td>Mathematics</td><td>male</td><td>43</td><td>34</td><td>28</td><td>78</td></tr>
567 <tr><td>Student42</td><td>Languages</td><td>female</td><td>11</td><td>89</td><td>60</td><td>95</td></tr>
568 <tr><td>Student43</td><td>Mathematics</td><td>male</td><td>48</td><td>92</td><td>18</td><td>88</td></tr>
569 <tr><td>Student44</td><td>Languages</td><td>female</td><td>82</td><td>2</td><td>59</td><td>73</td></tr>
570 <tr><td>Student45</td><td>Mathematics</td><td>male</td><td>91</td><td>73</td><td>37</td><td>39</td></tr>
571 <tr><td>Student46</td><td>Languages</td><td>female</td><td>4</td><td>8</td><td>12</td><td>10</td></tr>
572 <tr><td>Student47</td><td>Mathematics</td><td>male</td><td>89</td><td>10</td><td>6</td><td>11</td></tr>
573 <tr><td>Student48</td><td>Languages</td><td>female</td><td>90</td><td>32</td><td>21</td><td>18</td></tr>
574 <tr><td>Student49</td><td>Mathematics</td><td>male</td><td>42</td><td>49</td><td>49</td><td>72</td></tr>
575 <tr><td>Student50</td><td>Languages</td><td>female</td><td>56</td><td>37</td><td>67</td><td>54</td></tr>
576 </tbody>
577 </table>
578
579 </div>
580
581 <h1>Javascript</h1>
582 <div id="javascript">
583 <pre class="prettyprint lang-javascript"></pre>
584 </div>
585
586 <h1>HTML</h1>
587 <div id="html">
588 <pre class="prettyprint lang-html"></pre>
589 </div>
590
591 </div>
592
593 </body>
594 </html>