Mercurial > nebulaweb3
comparison default/node_modules/tablesaw/demo/sort-natural.html @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
1 <!doctype html> | |
2 <html lang="en"> | |
3 <head> | |
4 <meta charset="utf-8"> | |
5 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
6 <meta name="viewport" content="width=device-width, initial-scale=1"> | |
7 <title>TableSaw Sortable Table</title> | |
8 | |
9 <link rel="stylesheet" href="../dist/tablesaw.css"> | |
10 <link rel="stylesheet" href="demo.css"> | |
11 <link rel="stylesheet" href="//filamentgroup.github.io/demo-head/demohead.css"> | |
12 | |
13 <script>window.module = {};</script> | |
14 <script src="../dist/dependencies/naturalsort.js"></script> | |
15 <script>window.naturalSort = module.exports;</script> | |
16 | |
17 <script src="../dist/tablesaw.js"></script> | |
18 <script src="../dist/tablesaw-init.js"></script> | |
19 <script src="//filamentgroup.github.io/demo-head/loadfont.js"></script> | |
20 <script> | |
21 $(function() { | |
22 $( "#custom-sort" ).data( "tablesaw-sort", function( ascending ) { | |
23 return function( a, b ) { | |
24 // a.cell | |
25 // a.element | |
26 // a.rowNum | |
27 var cellA = a.cell, | |
28 cellB = b.cell; | |
29 | |
30 if( ascending ) { | |
31 return naturalSort( cellA, cellB ); | |
32 } else { | |
33 return naturalSort( cellB, cellA ); | |
34 } | |
35 }; | |
36 }); | |
37 }); | |
38 </script> | |
39 </head> | |
40 <body> | |
41 <div class="demo-header"> | |
42 <div class="company"> | |
43 <img src="http://filamentgroup.com/images/fg-logo-positive-sm-crop.png"> | |
44 </div> | |
45 <div class="details"> | |
46 <h1 class="description-container">Demo of <span class="repo-name">Tablesaw</span> | |
47 <span class="description">A group of plugins for responsive tables.</span> | |
48 </h1> | |
49 <ul class="outbound-links"> | |
50 <li><a href="https://github.com/filamentgroup/tablesaw">Code</a></li> | |
51 <li><a href="https://github.com/filamentgroup/tablesaw/issues">Issues</a></li> | |
52 </ul> | |
53 </div> | |
54 </div> | |
55 <div class="nav-container"> | |
56 <div class="docs-globalnav"> | |
57 <nav class="docs-nav"> | |
58 <a href="kitchensink.html">Kitchen Sink</a> | |
59 <a href="modeswitch.html">Mode Switch</a> | |
60 <a href="sort.html" class="current">Sortable</a> | |
61 <a href="stack.html">Stack</a> | |
62 <a href="stackonly.html">Stack Only</a> | |
63 <a href="swipe.html">Swipe Table</a> | |
64 <a href="toggle.html">Toggle</a> | |
65 </nav> | |
66 </div> | |
67 </div> | |
68 <div class="docs-main"> | |
69 <h2>Sortable Table</h2> | |
70 <h3 class="docs">Default appearance (with optional sortable-switch)</h3> | |
71 | |
72 <table class="tablesaw" data-tablesaw-sortable data-tablesaw-sortable-switch> | |
73 <thead> | |
74 <tr> | |
75 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="persist">Movie Title</th> | |
76 <th scope="col" data-tablesaw-sortable-col data-tablesaw-sortable-default-col data-tablesaw-priority="3">Rank</th> | |
77 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="2">Year</th> | |
78 <th scope="col" data-tablesaw-sortable-col data-tablesaw-priority="1">Not Natural</th> | |
79 <th id="custom-sort" scope="col" data-tablesaw-sortable-col data-tablesaw-priority="4">Natural</th> | |
80 </tr> | |
81 </thead> | |
82 <tbody> | |
83 <tr> | |
84 <td class="title"><a href="http://en.wikipedia.org/wiki/Avatar_(2009_film)">Avatar</a></td> | |
85 <td>1</td> | |
86 <td>2009/11</td> | |
87 <td>test 1</td> | |
88 <td>test 1</td> | |
89 </tr> | |
90 <tr> | |
91 <td class="title"><a href="http://en.wikipedia.org/wiki/Titanic_(1997_film)">Titanic</a></td> | |
92 <td>2</td> | |
93 <td>1997/12</td> | |
94 <td>test 2</td> | |
95 <td>test 2</td> | |
96 </tr> | |
97 <tr> | |
98 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Avengers_(2012_film)">The Avengers</a></td> | |
99 <td>3</td> | |
100 <td>2012/3</td> | |
101 <td>test 10</td> | |
102 <td>test 10</td> | |
103 </tr> | |
104 <tr> | |
105 <td class="title"><a href="http://en.wikipedia.org/wiki/Harry_Potter_and_the_Deathly_Hallows_%E2%80%93_Part_2">Harry Potter and the Deathly Hallows—Part 2</a></td> | |
106 <td>4</td> | |
107 <td>2011/5</td> | |
108 <td>test 13</td> | |
109 <td>test 13</td> | |
110 </tr> | |
111 <tr> | |
112 <td class="title"><a href="http://en.wikipedia.org/wiki/Frozen_(2013_film)">Frozen</a></td> | |
113 <td>5</td> | |
114 <td>2013/9</td> | |
115 <td>test 12</td> | |
116 <td>test 12</td> | |
117 </tr> | |
118 <tr> | |
119 <td class="title"><a href="http://en.wikipedia.org/wiki/Iron_Man_3">Iron Man 3</a></td> | |
120 <td>6</td> | |
121 <td>2013/1</td> | |
122 <td>test 22</td> | |
123 <td>test 22</td> | |
124 </tr> | |
125 <tr> | |
126 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Dark_of_the_Moon">Transformers: Dark of the Moon</a></td> | |
127 <td>7</td> | |
128 <td>2011/3</td> | |
129 <td>test 5</td> | |
130 <td>test 5</td> | |
131 </tr> | |
132 <tr> | |
133 <td class="title"><a href="http://en.wikipedia.org/wiki/The_Lord_of_the_Rings:_The_Return_of_the_King">The Lord of the Rings: The Return of the King</a></td> | |
134 <td>8</td> | |
135 <td>2003/4</td> | |
136 <td>test 8</td> | |
137 <td>test 8</td> | |
138 </tr> | |
139 <tr> | |
140 <td class="title"><a href="http://en.wikipedia.org/wiki/Skyfall">Skyfall</a></td> | |
141 <td>9</td> | |
142 <td>2012/11</td> | |
143 <td>test 9</td> | |
144 <td>test 9</td> | |
145 </tr> | |
146 <tr> | |
147 <td class="title"><a href="http://en.wikipedia.org/wiki/Transformers:_Age_of_Extinction">Transformers: Age of Extinction</a></td> | |
148 <td>10</td> | |
149 <td>2014/12</td> | |
150 <td>test 80</td> | |
151 <td>test 80</td> | |
152 </tr> | |
153 </tbody> | |
154 </table> | |
155 </div> | |
156 </body> | |
157 </html> |