Difference between revisions of "User:Belgrave/Wiki Hints/Sorting and Hiding Tables"
From Fallen Sword Wiki
< User:Belgrave | Wiki Hints
(New page: {| class="collapsible collapsed" style="width:100%; background:none" align="center" cellspacing="5" ! colspan="2" style="background-color:#cd9e4b; color:#000; border:1px solid #cd9e4b; fon...) |
Revision as of 20:34, 11 September 2008
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" |