Having a standard wiki table
{| class="sortable wikitable"
! Title
! Authors
! ID Number
|-
| '''Applying UML and Patterns'''
| Craig Larman
| ID432
...
how to make the table sort the table by the 3rd column (ID) ascending?
A sortable table is identified by the arrows in one or more of its header cells. Clicking them will cause the table rows to sort in ascending order based on the selected column. A second click on the same arrow will sort in descending order. A third click will restore the original order of the whole table.
How to Make Sortable Tables. Adding the "sortable" class to a <table> element provides support for sorting by column value. Clicking the column headers will sort the table rows by that column's value.
Sort Table by Clicking the Headers. Click the headers to sort the table. Click "Name" to sort by names, and "Country" to sort by country. The first time you click, the sorting direction is ascending (A to Z).
According to MediaWiki documentation:
When users are first presented with a table, the rows will always appear in the same order as in the wikitext. If you want a table to appear sorted by a certain column, you must sort the wikitext itself in that order. This is usually done for the first column.
Hope it helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With