Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default sort column in Wikipedia table

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?

like image 470
Parobay Avatar asked Apr 22 '13 06:04

Parobay


People also ask

How do you sort a table in Wikipedia?

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 do you sort a column in HTML?

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.

How do you add a sort to a table?

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).


1 Answers

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!

like image 73
Isaac Contreras Avatar answered Oct 22 '22 05:10

Isaac Contreras