User:Belgrave/Wiki Hints/Sorting and Hiding Tables
From Fallen Sword Wiki
Sorting and Hiding Tables + | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Many times, information listed in a table would be very helpful if you could sort it based on the information in each column. This is done by adding class="sortable" to the table. There must be a table header row for this to work. | |||||||||||||
{| class="sortable" width="100%" ! Col 1 !! Col 2 !! Col 3 |- | 1 || green || 45 |- | 6 || blue || 23 |- | 4 || red || 44 |}
|
| ||||||||||||
When the information in a table is useful but not always needed, it can be helpful to hide (collapse) a table and make it less obtrusive to the rest of the page. This is done by adding class="collapsible" to the table. There must be a table header for this to work. | |||||||||||||
{| class="collapsible" width="100%" ! colspan="3" | header |- | 1 || green || 45 |- | 6 || blue || 23 |- | 4 || red || 44 |}
|
| ||||||||||||
To have a table load already collapsed, use class="collapsible collapsed". You can also have a sortable collapsed table, once again by adding all the classes so you have class="collapsible collapsed sortable" |