Content deleted Content added
No edit summary Tags: Reverted Visual edit: Switched |
m Reverted edit by 24.72.54.160 (talk) to last version by Numbermaniac |
||
Line 12:
If you are using the [[Wikipedia:VisualEditor|Visual Editor]], you can open the properties dialog of a table and select the sortable option.
=== Simple example ===
This is the wikitext of the table [[Help:Sortable tables#Example|shown]] in the first section and shows the typical way to enable table sorting:
<syntaxhighlight lang="wikitext">
{| class="wikitable sortable"
|-
! name
! data
! more data
|-
| cats
| 273
| 53
|-
| dogs
| 65
| 8,492
|-
| mice
| 1,649
| 548
|}
</syntaxhighlight>
The <code>!</code> indicates cells that are header cells. In order for a table to be sortable, the first row(s) of a table need to be entirely made up out of these header cells. You can learn more about the basic table syntax by taking the [[Help:Table/Introduction to tables|Introduction to tables]] for source editing.
=== Initial sort order of rows ===
|