Last active
August 29, 2015 14:25
-
-
Save mnishiguchi/920ed66b964330c7f4c1 to your computer and use it in GitHub Desktop.
TableSorter( jQuery plug-in)で簡単に表のソートを実装する。 ref: http://qiita.com/mnishiguchi/items/87aacf94eee776aa261a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %table#myTable | |
| %thead | |
| %tr | |
| %th | |
| %span.arrow | |
| / <=ここにアイコンを挿入する。 | |
| %th | |
| %span.arrow | |
| / <=ここにアイコンを挿入する。 | |
| %th{ span: "2" } | |
| %tbody | |
| %tr | |
| %td 列1データ1 | |
| %td 列1データ2 | |
| %td ... | |
| %td ... | |
| %tr | |
| %td 列2データ1 | |
| %td 列2データ2 | |
| %td ... | |
| %td ... | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready -> | |
| $("#myTable").tablesorter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* ヘッダーをクリックすると勝手にハイライトされるので、それを除去する。 */ | |
| th:focus { outline: 0 none; } | |
| /* 三角印アイコンをヘッダーに追加する */ | |
| th.tablesorter-headerUnSorted span.arrow, | |
| th.tablesorter-headerAsc span.arrow, | |
| th.tablesorter-headerDesc span.arrow { | |
| position: relative; | |
| } | |
| th.tablesorter-headerUnSorted span.arrow:before { | |
| content: "\f0dc"; | |
| font-family: FontAwesome; | |
| font-style: normal; | |
| font-weight: normal; | |
| text-decoration: inherit; | |
| color: #ABC; | |
| } | |
| th.tablesorter-headerAsc span.arrow:before { | |
| content: "\f0de"; | |
| font-family: FontAwesome; | |
| font-style: normal; | |
| font-weight: normal; | |
| text-decoration: inherit; | |
| } | |
| th.tablesorter-headerDesc span.arrow:before { | |
| content: "\f0dd"; | |
| font-family: FontAwesome; | |
| font-style: normal; | |
| font-weight: normal; | |
| text-decoration: inherit; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment