回答編集履歴

3

説明の補足

2016/07/05 08:32

投稿

FKM
FKM

スコア3640

test CHANGED
@@ -1,4 +1,4 @@
1
- tablesorterはこういう風にメタデータを活用することができるので、ここにダミーの値を入れてみては如何でしょうか?
1
+ tablesorterはこういう風にメタデータを活用することができるので、ここにダミーの値を入れてみては如何でしょうか?見かけは<td>タグ内の値ですが、実際のソートはsortValueの値を使って行われるようになります。
2
2
 
3
3
  [「漢字」や「単位付き数値」などが含まれる項目でも、意図通りにソートさせる](http://allabout.co.jp/gm/gc/434260/4/)
4
4
 

2

コードの修正

2016/07/05 08:32

投稿

FKM
FKM

スコア3640

test CHANGED
@@ -26,17 +26,21 @@
26
26
 
27
27
  <td class="{sortValue:3}">大</td>
28
28
 
29
- <td class="{sortValue:2}"></td>
29
+ <td class="{sortValue:3}">だい</td>
30
-
31
- <td class="{sortValue:1}">小</td>
32
30
 
33
31
  </tr>
34
32
 
35
33
  <tr>
36
34
 
37
- <td class="{sortValue:3}">だい</td>
35
+ <td class="{sortValue:2}"></td>
38
36
 
39
37
  <td class="{sortValue:2}">ちゅう</td>
38
+
39
+ </tr>
40
+
41
+ <tr>
42
+
43
+ <td class="{sortValue:1}">小</td>
40
44
 
41
45
  <td class="{sortValue:1}">しょう</td>
42
46
 

1

コードの追加

2016/07/05 08:30

投稿

FKM
FKM

スコア3640

test CHANGED
@@ -1,4 +1,4 @@
1
- tablesorterはこういうことができるので、ここにダミーの値を入れてみては如何でしょうか?
1
+ tablesorterはこういう風にメタデータを活用することができるので、ここにダミーの値を入れてみては如何でしょうか?
2
2
 
3
3
  [「漢字」や「単位付き数値」などが含まれる項目でも、意図通りにソートさせる](http://allabout.co.jp/gm/gc/434260/4/)
4
4
 
@@ -6,10 +6,44 @@
6
6
 
7
7
  ```
8
8
 
9
+ <table class="xxxxx">
10
+
11
+ <thead>
12
+
13
+ <tr>
14
+
15
+ <th class="{sorter:'metadata'}">漢字</th>
16
+
17
+ <th class="{sorter:'metadata'}">ひらがな</th>
18
+
19
+ </tr>
20
+
21
+ </thead>
22
+
23
+ <tbody>
24
+
25
+ <tr>
26
+
27
+ <td class="{sortValue:3}">大</td>
28
+
29
+ <td class="{sortValue:2}">中</td>
30
+
31
+ <td class="{sortValue:1}">小</td>
32
+
33
+ </tr>
34
+
35
+ <tr>
36
+
9
37
  <td class="{sortValue:3}">だい</td>
10
38
 
11
39
  <td class="{sortValue:2}">ちゅう</td>
12
40
 
13
41
  <td class="{sortValue:1}">しょう</td>
14
42
 
43
+ </tr>
44
+
45
+ </tbody>
46
+
47
+ </table>
48
+
15
49
  ```