User:RexxS/Sorting

Sortable tables can be sorted on any column by clicking on the sort icon once for an ascending source, and clicking again for a descending sort.

Sometimes, for example with date ranges, we don't get the expected results. The fix for it is to use a sort key.

1. Here's the table as it was at 10:24, 10 September when Gimmetoo changed dashes to hyphens – edit summary (-v): Does an descending sort on 'Year' work properly?

2. Here's the table as it was at 10:14, 10 September when Rossrs restored the dashes – edit summary (removed height. not sourced and not relevant. delinked common words per WP:OVERLINK, fixed dashes using a script): Does an descending sort on 'Year' work properly?

3. Here's the table as it was at 02:33, 16 September when RexxS added a sort key – edit summary (add hidden sort key to ensure accurate sorting): Does an descending sort on 'Year' work properly?

4. As long as we're doing it, for comparison here's another version that incorporates RexxS' other changes. The sort order of "2007" and "2007-present" is not the issue. Indeed, in this case, the 2007 appearance seems to have been in October 2007, while the 2007-present appearances started in September 2007, so that ordering is potentially ambiguous and would need some discussion to resolve.

So here are the questions:
 * 1) Does changing dashes in date ranges to hyphen produce a table that sorts properly?
 * 2) Does adding a sort key (even with dashes in date ranges) produce a table that sorts properly?

5. Here is a version that should work in Safari 4 and use proper dashes. By using a sort key on every cell in the column that contains mixed numbers and text, we can ensure an accurate sort on a wider range of browsers.