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

Placement and size changes
How to alter a table's size, placement and structure

Adding colour
Using colour in tables

Collapsible tables
Making tables that collapse

Other formatting
What else can you do?


Columns can be sorted by adding the sortable class:

{| class="wikitable sortable" border="1"
|-
! 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.