Help:Sortable tables: Difference between revisions

Content deleted Content added
Date sorting problems: Don't hide links behind "here" for accessibility
Date table sorting template. Many date formats: Don't hide links behind "here" for accessibility
Line 2,022:
The simplest way to format sortable dates in a table is to use the '''{{tl|Date table sorting}}''' template. A redirect: '''{{tl|dts}}'''
 
It can be used with many date formats mixed together. Note the many formats used '''([[List of PC games (A)|hereexample]]).''' See [[Template:Date table sorting]] for more info. In the tables below, all columns sort correctly. The wikitext for the first entry in each table in the first row is shown in the table header.
 
'''Note:''' None of the table columns use the <code>data-sort-type=</code> modifier. Using <code>data-sort-type=</code> can sometimes break sorting when used with the template. If you want the column to be narrower, you can use month abbreviations ('''''abbr=on''''' parameter). You can also allow the text to wrap ('''''nowrap=off''''' parameter). Use '''''format=dmy''''' or '''''format=mdy''''', etc. to control output format, if desired.
See example tables below. They all sort correctly. The wikitext for the first entry in each table in the first row is shown in the table header.
 
'''Note:''' None of the table columns use the <code>data-sort-type=</code> modifier. Using <code>data-sort-type=</code> can sometimes break sorting when used with the template. If you want the column to be narrower, you can use month abbreviations ('''''abbr=on''''' parameter). You can also allow the text to wrap ('''''nowrap=off''''' parameter). Use '''''format=dmy''''' or '''''format=mdy''''', etc. to control output format, if desired.
 
<div style="display:inline-table; vertical-align:top;">