User talk:Gearzein/Sandbox

Table sorting
The problem illustrated in the "control" table may very well be a bug; according to wikipedia:Help:Sorting, cells in columns sorted numerically whose contents evaluate to NaN are supposed to be treated as -∞ rather than zero.

Anyway, for a slightly more elegant (if still brute force) solution, see the bottom of the sandbox. The table there makes use of the  attribute to cause all "empty" cells to be treated as an arbitrarily low number (I chose -100) and thus always display at the bottom of the table.

71.161.110.46 08:58, 13 February 2015 (UTC)
 * Thanks for pointing this out to me. This'll reduce a lot of clumsy forced alphabetization into a quick find-and-replace. Just as a guess, the "-" characters used to fill empty spots on the tables were making it read alphabetically, hence the 10/5/7 sorting; presumably "+" is considered to come before "-" alphabetically, causing "-20" to come last. Or something. Why using data-sort-type=number in the column header causes it to read both spaces and "-" as zeroes is beyond me, but at the moment your solution is probably the wiki's best bet.
 * The whole thing's protected anyway, so as long as it works on the page, the end user doesn't have to know how silly it looks under the hood. Thanks for the assist, and keep up the good work. Gearzein (talk) 12:33, 13 February 2015 (UTC)