-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
356 lines (355 loc) · 11.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="sortable.svg">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<link rel="stylesheet" href="sortable.css">
<title>Sortable</title>
</head>
<body>
<header class="bg-dark text-light py-5 mb-5">
<div class="container">
<h1 class="display-1 mb-4"><i class="bi-arrow-down-up"></i> Sortable</h1>
<p class="lead mb-4">Super simple, completely configurable, sortable tables.</p>
<a class="btn btn-secondary" href="https://github.com/signified/sortable" target="_blank"><i class="bi-github"></i> View on GitHub</a>
</div>
</header>
<main>
<div class="container">
<h2 class="display-6">Basic usage</h2>
<p>The below example makes the table with the <code>id</code> attribute value of <code>example-1</code> sortable using the default <a href="https://github.com/signified/sortable#options-object--optional" target="_blank"><code>options</code></a> and styling provided by the default stylesheet (<a href="https://github.com/signified/sortable/blob/main/sortable.css" target="_blank">sortable.css</a>).</p>
<pre class="mb-5 p-4 bg-light border rounded">sortable('#example-1');</pre>
<table class="table" id="example-1">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Surname</th>
<th>Date of Birth</th>
<th>Email Address</th>
<th>Donation</th>
<th>IP Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>8074</td>
<td>Gay</td>
<td>Clark</td>
<td>Jul 14, 1991</td>
<td>[email protected]</td>
<td>20.02</td>
<td>95.230.218.101</td>
</tr>
<tr>
<td>8548</td>
<td>Candace</td>
<td>Cain</td>
<td>Apr 17, 1995</td>
<td>[email protected]</td>
<td>99.33</td>
<td>124.157.239.56</td>
</tr>
<tr>
<td>2878</td>
<td>Zeph</td>
<td>Acosta</td>
<td>Aug 11, 1991</td>
<td>[email protected]</td>
<td>97.88</td>
<td>237.147.199.198</td>
</tr>
<tr>
<td>8586</td>
<td>Yoshio</td>
<td>Hopper</td>
<td>Jul 1, 2000</td>
<td>[email protected]</td>
<td>78.07</td>
<td>214.183.243.28</td>
</tr>
<tr>
<td>7336</td>
<td>Ursula</td>
<td>Welch</td>
<td>Aug 21, 1995</td>
<td>[email protected]</td>
<td>64.97</td>
<td>54.113.112.160</td>
</tr>
<tr>
<td>8353</td>
<td>Ivor</td>
<td>Combs</td>
<td>Jun 12, 1999</td>
<td>[email protected]</td>
<td>53.30</td>
<td>177.224.126.72</td>
</tr>
<tr>
<td>5589</td>
<td>Simon</td>
<td>Haley</td>
<td>Jun 8, 1992</td>
<td>[email protected]</td>
<td>72.56</td>
<td>217.236.56.182</td>
</tr>
<tr>
<td>2873</td>
<td>Orlando</td>
<td>Zamora</td>
<td>Jul 31, 1991</td>
<td>[email protected]</td>
<td>38.83</td>
<td>117.200.39.162</td>
</tr>
<tr>
<td>2175</td>
<td>Colt</td>
<td>Lucas</td>
<td>Apr 30, 1995</td>
<td>[email protected]</td>
<td>70.90</td>
<td>68.114.16.232</td>
</tr>
<tr>
<td>1875</td>
<td>Colette</td>
<td>Stout</td>
<td>May 11, 1995</td>
<td>[email protected]</td>
<td>84.21</td>
<td>112.142.211.169</td>
</tr>
</tbody>
</table>
<h2 class="display-6">Advanced usage</h2>
<p>The below example makes the table with the <code>id</code> attribute value of <code>example-2</code> sortable and makes use of the <a href="https://github.com/signified/sortable#options-object--optional" target="_blank"><code>options</code></a> parameter to add custom CSS classes.</p>
<pre class="mb-5 p-4 bg-light border rounded">sortable('#example-2', {
buttonClasses: ['btn', 'btn-sm', 'btn-outline-dark', 'w-100'],
sortClasses: ['bg-light'],
sortStringClasses: ['fst-italic'],
sortNumberClasses: ['font-monospace', 'text-end', 'small'],
sortDateClasses: ['text-uppercase', 'small'],
sortDotDecimalClasses: ['font-monospace', 'text-end', 'small'],
sortAscendingClasses: ['bg-opacity-100'],
sortDescendingClasses: ['bg-opacity-75']
});</pre>
<table class="table" id="example-2">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Surname</th>
<th>Date of Birth</th>
<th>Email Address</th>
<th>Donation</th>
<th>IP Address</th>
</tr>
</thead>
<tbody>
<tr>
<td>2539</td>
<td>Naida</td>
<td>Day</td>
<td>Jul 4, 1987</td>
<td>[email protected]</td>
<td>86.13</td>
<td>13.212.157.126</td>
</tr>
<tr>
<td>2903</td>
<td>Ignatius</td>
<td>Yang</td>
<td>Dec 8, 1995</td>
<td>[email protected]</td>
<td>91.26</td>
<td>85.93.101.112</td>
</tr>
<tr>
<td>2378</td>
<td>Vincent</td>
<td>Ruiz</td>
<td>Feb 15, 1994</td>
<td>[email protected]</td>
<td>47.91</td>
<td>2.42.135.144</td>
</tr>
<tr>
<td>4752</td>
<td>Hilda</td>
<td>Larson</td>
<td>May 11, 1986</td>
<td>[email protected]</td>
<td>22.29</td>
<td>72.134.238.161</td>
</tr>
<tr>
<td>3852</td>
<td>Brenden</td>
<td>Santiago</td>
<td>Aug 22, 1995</td>
<td>[email protected]</td>
<td>22.62</td>
<td>24.57.165.54</td>
</tr>
<tr>
<td>5365</td>
<td>MacKensie</td>
<td>Hess</td>
<td>Nov 4, 1994</td>
<td>[email protected]</td>
<td>40.67</td>
<td>176.53.119.255</td>
</tr>
<tr>
<td>1965</td>
<td>Colton</td>
<td>Cervantes</td>
<td>Jan 17, 1997</td>
<td>[email protected]</td>
<td>43.33</td>
<td>97.205.145.49</td>
</tr>
<tr>
<td>6526</td>
<td>Morgan</td>
<td>Monroe</td>
<td>Jul 30, 2000</td>
<td>[email protected]</td>
<td>29.35</td>
<td>60.211.192.84</td>
</tr>
<tr>
<td>4969</td>
<td>Gareth</td>
<td>Key</td>
<td>Nov 24, 1999</td>
<td>[email protected]</td>
<td>62.56</td>
<td>206.221.197.88</td>
</tr>
<tr>
<td>6534</td>
<td>Nichole</td>
<td>Pacheco</td>
<td>Nov 19, 1995</td>
<td>[email protected]</td>
<td>22.96</td>
<td>157.232.111.27</td>
</tr>
<tr>
<td>9985</td>
<td>Bevis</td>
<td>Pittman</td>
<td>Jun 29, 1997</td>
<td>[email protected]</td>
<td>69.17</td>
<td>218.230.218.226</td>
</tr>
<tr>
<td>9998</td>
<td>Xavier</td>
<td>Mullen</td>
<td>Sep 12, 2002</td>
<td>[email protected]</td>
<td>46.47</td>
<td>45.73.4.132</td>
</tr>
<tr>
<td>5065</td>
<td>Stewart</td>
<td>Wood</td>
<td>Mar 7, 1993</td>
<td>[email protected]</td>
<td>9.47</td>
<td>7.99.32.216</td>
</tr>
<tr>
<td>8862</td>
<td>Tatiana</td>
<td>Gray</td>
<td>Jun 26, 1988</td>
<td>[email protected]</td>
<td>53.48</td>
<td>190.131.31.230</td>
</tr>
<tr>
<td>5124</td>
<td>Haley</td>
<td>Reese</td>
<td>Sep 15, 1993</td>
<td>[email protected]</td>
<td>74.74</td>
<td>157.26.203.196</td>
</tr>
<tr>
<td>3686</td>
<td>Karina</td>
<td>Barrera</td>
<td>Mar 21, 1985</td>
<td>[email protected]</td>
<td>97.85</td>
<td>192.249.114.156</td>
</tr>
<tr>
<td>8639</td>
<td>Katelyn</td>
<td>Stephenson</td>
<td>Jul 17, 2002</td>
<td>[email protected]</td>
<td>91.92</td>
<td>237.242.178.0</td>
</tr>
<tr>
<td>3977</td>
<td>Cally</td>
<td>Mccray</td>
<td>Jun 1, 1990</td>
<td>[email protected]</td>
<td>4.09</td>
<td>243.146.10.64</td>
</tr>
<tr>
<td>5642</td>
<td>Hop</td>
<td>Gross</td>
<td>Jul 13, 1989</td>
<td>[email protected]</td>
<td>88.55</td>
<td>247.85.6.89</td>
</tr>
<tr>
<td>8288</td>
<td>Tate</td>
<td>Myers</td>
<td>Sep 11, 1988</td>
<td>[email protected]</td>
<td>39.47</td>
<td>6.15.221.239</td>
</tr>
</tbody>
</table>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="sortable.js"></script>
<script>
sortable('#example-1');
sortable('#example-2', {
buttonClasses: ['btn', 'btn-sm', 'btn-outline-dark', 'w-100'],
sortClasses: ['bg-light'],
sortStringClasses: ['fst-italic'],
sortNumberClasses: ['font-monospace', 'text-end', 'small'],
sortDateClasses: ['text-uppercase', 'small'],
sortDotDecimalClasses: ['font-monospace', 'small'],
sortAscendingClasses: ['bg-opacity-100'],
sortDescendingClasses: ['bg-opacity-75']
});
</script>
</body>
</html>