표에서 정렬키를 설정하는 틀이다. sort type인 data-sort-value의 값을 설정한다.

사용법

{{sort |sort문자열 |(보여지는문자열) }}


사용예

  • 리본적으로 class에 sortable 값이 지정된 상태에서 셀 앞 부분에서 다음과 같이 사용할 수 있다.
입력한 내용
{| class="wikitable sortable"
! Name and Surname !! Height
|-
| data-sort-value="Smith, John" | John Smith || 1.85
|-
| data-sort-value="Ray, Ian" | Ian Ray || 1.89
|-
| data-sort-value="Bianchi, Zachary" | Zachary Bianchi || 1.72
|}
보여지는 결과
Name and Surname Height
John Smith 1.85
Ian Ray 1.89
Zachary Bianchi 1.72


sort mode

sort mode는 data-sort-type="date"등과 같이 사용이 가능하며 data-sort-type은 다음과 같다.

  • text
  • number
  • IPAddress
  • currency
  • url
  • isoDate
  • usLongDate
  • date
  • time
입력한 내용
{|class="wikitable sortable"
!data-sort-type="date" | Date!!Name !! Height !! data-sort-type="number" | Salary
|-
|01.10.1977 || Smith || 1.85 || 1,000.000
|-
|11.6.1972 || Ray || 1.89 || 900.000
|-
|1.9.1992 || Bianchi || 1.72 || 2,000.50
|}
보여지는 결과
Date Name Height Salary
01.10.1977 Smith 1.85 1,000.000
11.6.1972 Ray 1.89 900.000
1.9.1992 Bianchi 1.72 2,000.50


  • class="unsortable" 옵션을 사용하면 정렬버튼이 생기지 않는다. 또한 class="sorttop"을 제일 윗줄에 지정하여 사용할 수 있다.
입력한 내용
{| class="wikitable sortable"
! Name !! Surname !! Height
|- class="sorttop"
!   !! Average: !! 1.82
|-
| John || Smith || 1.85
|-
| Ron || Ray || 1.89
|-
| Mario || Bianchi || 1.72
|}
보여지는 결과
Name Surname Height
Average: 1.82
John Smith 1.85
Ron Ray 1.89
Mario Bianchi 1.72


입력한 내용
{| class="wikitable sortable"
! Name !! Surname !! Height
|-
| John || Smith || 1.85
|-
| Ron || Ray || 1.89
|-
| Mario || Bianchi || 1.72

|- class="sortbottom"
!  !! Average: !! 1.82
|}
보여지는 결과
Name Surname Height
John Smith 1.85
Ron Ray 1.89
Mario Bianchi 1.72
Average: 1.82