Help:Table/Sortable tables

From Wikipedia, the free encyclopedia
Jump to: navigation, search


Introduction to tables
What are they for and how do I make them?

Creating tables manually
Want more control over tables? Go here

Sortable tables
How to make tables sortable

HTML and tables
How to use HTML with tables


All columns can be sorted by adding the sortable class to the table:

{| class="wikitable sortable"
|-
! name
! data
! more data
|-
| cats
| 273
| 53
|-
| dogs
| 65
| 8,492
|-
| mice
| 1,649
| 548
|}

name data more data
cats 273 53
dogs 65 8,492
mice 1,649 548

Clicking on the up/down arrows in a column header will sort the column; clicking again will reverse the sort. Columns containing text will be sorted alphabetically; columns containing numbers will be sorted numerically. Columns containing mixed data will be sorted alphabetically. For advanced sort options, see Help:Sorting.