Talk:Bonding Table

From Tar Valon Library
Jump to: navigation, search

Any idea how to force sorting by date? The Wiki help page said it should be possible, but it gets broken if dates are in the wrong format (such as year only), but you can add a hidden bit with the normal sorting https://en.wikipedia.org/wiki/Help:Sorting#Forcing_a_column_to_have_a_particular_data_type

https://en.wikipedia.org/wiki/Help:Sorting#Date_sorting_problems

https://en.wikipedia.org/wiki/Help:Sorting#Dates

One way to ensure each row is sorted appropriately is to add identical hidden rows ( |-style="display:none;" ) to the top and bottom of the table. If these contain very high and very low values of the appropriate type for sorting each column, then no matter what sorting is done, one of the rows always remains at the top and one at the bottom of the table, forcing the appropriate mode for the next sort. If it is acceptable to keep identical rows fixed at the top and the bottom of a table, these can be implemented using less extreme high and low hidden sort key values. The hidden rows to force proper sort type may be unnecessary if the rows for display at the top and bottom of the table contain the right sort of values. For example, the hidden top and bottom rows in the example below can be deleted without harm, but if "(meters)" were added in the third column they would be needed.

Since the numeric sorting recognizes scientific notation, the number 9e99 and its negative are good candidates for forced numeric sorting when dealing with tables that contain large numbers. On the other hand, characters are ranked "ASCIIbetically", which places the exclamation mark (!) as the first sortable character and the tilde key (~) as the last; as such those two characters are good candidates for alphabetical sorting.

https://en.wikipedia.org/wiki/Help:Sorting#Sorting with a hidden key

This methodology is deprecated, in favor of using data-sort-value. You can customize the sorting on a table by placing a value that is easily sorted before the content, and then hiding that value with HTML/CSS. To do this, enclose the value you wish to hide in and , or use the template Template:Hs. For example, this technique can be used to create a sortable table containing the months: