Help:Sortable tables: Difference between revisions

Content deleted Content added
Line 1,245:
To work '''<code>data-sort-type=number</code>''' needs to be in the '''header cell''' that '''contains the sorting icon.''' In tables with multi-row headers, the sorting icon will be in the lowest header cells.
 
When '''<code>data-sort-type=number</code>''' is '''not in the header''' the following is true:
*References <code><nowiki><ref>...</ref></nowiki></code> after a number in any cell (including the first five cells) no longer break numerical sorting.
*The same is true for the percent symbol (%) after a number.
*Text breaks default numerical sorting if it is before or after a number in one of the first 5 cells in a column.
*A dash,colon ofby anyitself kind,(to insignify ano blankdata, cellfor example) in one of the first 5 cells in a column breaks default numerical sorting of a column.
*A dash, of any kind, ''in a blank cell'' in one of the first 5 cells in a column breaks default numerical sorting of a column.
*A dash ''in front of a number'' does not break numerical sorting.
 
Dashes are allowed anywhere in cells if <code>data-sort-type=number</code> is used in the column header.
Text breaks default numerical sorting if it is before or after a number in one of the first 5 cells in a column.
 
AEven colonwhen byusing itself<code>data-sort-type=number</code> (toin signifythe nocolumn dataheader, for example)text in onefront of the first 5a cellsnumber in aany columncell breaks numerical sorting of that cell.
 
Even when using <code>data-sort-type=number</code> in the column header, text in front of a number in any cell breaks numerical sorting of that cell. Text after a number is not a problem if the sort order of a column is specified by using <code>data-sort-type=number</code>.
 
Leading zeroes are not necessary for numerical sorting of a column. If it seems that way, then that means the column is being sorted alphabetically. Look in the first 5 cells for anything other than numbers, and correct those cells according to these rules. Better yet, add <code>data-sort-type=number</code> to the column header. Later editing by other editors will not break numerical sorting.
 
A dash, of any kind, in a blank cell in one of the first 5 cells in a column breaks default numerical sorting of a column.
 
A dash in front of a number does not break numerical sorting.
 
Dashes are allowed anywhere in cells if <code>data-sort-type=number</code> is used in the column header.
 
The {{tl|N/A}} template in the first five cells of a column is inconsistent in its effect on automatic datatype detection. It is always better to specify a <code>data-sort-type</code> in the column header.