Debian Codegraph @

docs/example-parsers-class-name.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>jQuery tablesorter 2.0 - Disable sorting or set the column parser using class names</title>
6
7 <!-- jQuery -->
8 <script src="js/jquery-latest.min.js"></script>
9
10 <!-- Demo stuff -->
11 <link rel="stylesheet" href="css/jq.css">
12 <link href="css/prettify.css" rel="stylesheet">
13 <script src="js/prettify.js"></script>
14 <script src="js/docs.js"></script>
15
16 <!-- Tablesorter: required -->
17 <link rel="stylesheet" href="../css/theme.blue.css">
18 <script src="../js/jquery.tablesorter.js"></script>
19
20 <script id="js">$(function() {
21 $("table").tablesorter({ theme: 'blue' });
22 });</script>
23 </head>
24 <body>
25 <div id="banner">
26 <h1>table<em>sorter</em></h1>
27 <h2>Disable sorting or set the column parser using class names</h2>
28 <h3>Flexible client-side table sorting</h3>
29 <a href="index.html">Back to documentation</a>
30 </div>
31 <div id="main">
32
33 <p class="tip">
34 <em>NOTE!</em>
35 </p>
36 <ul>
37 <li>In tablesorter version 2.0.5 and older, only the metadata and headers options methods were available to set the parsers.</li>
38 <li>There may be some confusion as to the wording of this example page:
39 <ul>
40 <li>Set the sorter to false to prevent sorting.</li>
41 <li>Prevent parsing a column by setting the parser to false - added v2.17.1 - get more details on <a href="example-options-headers-parser.html">this page</a></li>
42 </ul>
43 </li>
44 <li>In versions 2.0.11+, parsers could be set using class names.</li>
45 <li>Currently (versions 2.3+), parsers can be set using any of the following methods (they all do the same thing), in order of priority:
46 <ul>
47 <li>jQuery data <code>data-sorter="text"</code> (see the Javascript block below on how to set it directly).</li>
48 <li>metadata <code>class="{ sorter: "text" }"</code>. This requires the metadata plugin.</li>
49 <li>headers option <code>headers : { 0 : { sorter: "text" } }</code>.</li>
50 <li>header class name <code>class="sorter-text"</code>.</li>
51 </ul>
52 </li>
53 </ul>
54
55 <h1>Demo</h1>
56 <div id="demo"><table class="tablesorter">
57 <thead>
58 <tr>
59 <th class="sorter-text">First Name</th>
60 <th class="sorter-text">Last Name</th>
61 <th class="sorter-false">Age</th>
62 <th class="sorter-currency string-min">Total</th> <!-- class="string-min" treats strings in this numeric column as a large negative number -->
63 <th class="sorter-percent empty-top">Discount</th> <!-- class="empty-top" sorts empty cells to the top -->
64 <th class="sorter-usLongDate">Date</th>
65 </tr>
66 </thead>
67 <tbody>
68 <tr>
69 <td>Peter</td>
70 <td>Parker</td>
71 <td>28</td>
72 <td>($9.99)</td>
73 <td>20%</td>
74 <td>Jul 6, 2006 8:14 AM</td>
75 </tr>
76 <tr>
77 <td>John</td>
78 <td></td>
79 <td>33</td>
80 <td>$19.99</td>
81 <td>25%</td>
82 <td>Dec 10, 2002 5:14 AM</td>
83 </tr>
84 <tr>
85 <td>Clark</td>
86 <td>Kent</td>
87 <td>18</td>
88 <td></td>
89 <td>44%</td>
90 <td>Jan 12, 2003 11:14 AM</td>
91 </tr>
92 <tr>
93 <td>Bruce</td>
94 <td>Almighty</td>
95 <td>45</td>
96 <td>$153.19</td>
97 <td>44%</td>
98 <td></td>
99 </tr>
100 <tr>
101 <td>Bruce</td>
102 <td>Evans</td>
103 <td>22</td>
104 <td>N/A</td>
105 <td></td>
106 <td>Jan 18, 2007 9:12 AM</td>
107 </tr>
108 <tr>
109 <td></td>
110 <td>Evans</td>
111 <td>18</td>
112 <td>$13.19</td>
113 <td>11%</td>
114 <td>Jul 6, 2006 8:14 AM</td>
115 </tr>
116 </tbody>
117 </table></div>
118
119 <h1>Javascript</h1>
120 <div id="javascript">
121 <pre class="prettyprint lang-javascript"></pre>
122 </div>
123 <h1>HTML</h1>
124 <div id="html">
125 <pre class="prettyprint lang-html"></pre>
126 </div>
127
128 <div class="next-up">
129 <hr />
130 Next up: <a href="example-parsers-jquery-data.html">Disable or set the column parser using jQuery data &rsaquo;&rsaquo;</a>
131 </div>
132
133 </div>
134
135 </body>
136 </html>