| Latest revision |
Your text |
| Line 106: |
Line 106: |
| == Creating sortable tables == | | == Creating sortable tables == |
| === Example === | | === Example === |
| {| class="messagebox sortable"
| | |
| ! Name !! Address !! ZIP code
| |
| |-
| |
| | John Doe || 1239 Figueroa Ave || 1234hx
| |
| |-
| |
| | Bill Example || 260 Park Ave || 1234HX
| |
| |-
| |
| | Jane Doe || 148 13th St. || 123456
| |
| |}
| |
| *Note that:
| |
| **The tables sort alphabetically, not numerically. This might cause unexpected results when you sort by Address in this example.
| |
| **Numbers are sorted above letters. Captial letters are sorted the same as their lowercase equivalents. Sort by the ZIP Code field in this example to see for yourself.
| |
| **In the same fashion, the Name field will by sorted by first name, not by last name. If you want to sort by last names, make a separate field for last names.
| |
| **Any table can be made sortable just by adding <code>sortable</code> to the <code>class=</code> list.
| |
| === Code === | | === Code === |
| <pre>
| |
| {| class="messagebox sortable"
| |
| ! Name !! Address !! ZIP code
| |
| |-
| |
| | John Doe || 1239 Figueroa Ave || 1234hx
| |
| |-
| |
| | Bill Example || 260 Park Ave || 1234HX
| |
| |-
| |
| | Jane Doe || 148 13th St. || 123456
| |
| |}
| |
| </pre>
| |