# User talk:Killian
Sortable tables
Hi Killian,
Thanks for your help at Polearm with the abbreviations in the table headers. I was looking at some of your automatically generated tables (such as at Gem (program at Talk:Gem)) and I think they could be improved by making the tables sortable. Then you can gather all the hard gems together, or sort them alphabetically by name, or numerically by value, or whatever you want. All you have to do is give the table the css class "sortable" and give any columns that shouldn't be sortable the class "unsortable". I've done some example code based on your original program here with example output here.
(One other issue with sortable tables is that sorting doesn't play nice with horizontal separators between different categories (gems and glass, different categories of weapons, etc)).
I don't know if this is worth reautomating or should I go and edit all the tables manually? Rhebus 12:24, 1 September 2009 (UTC)

Maintaining the programs sounds like a better idea in the long run. Feel free to overwrite any of my programs that need updating; that's what history's for after all.
Apart from Gem, which generators would be worth making sortable? I can't think of any off the top of my head, though on the other hand I had completely forgotten that the Gem table was my work at all. Other than the Gem table and the skill tables (which can't meaningfully be sorted), what have I done?
As for the separators, I think it would be best to either remove them entirely, or else split the table into separate tables, unless Mediawiki has some fancy grouping features I'm unaware of. -- Killian 13:10, September 2, 2009 (UTC)
I made the table at Polearm sortable to find the best polearm by weight, sdmg, ldmg, or to sort by description to find the name ("What's this 'vulgar polearm'?"). I can't immediately think of other categories which would benefit greatly from sorting: other weapons don't have enough variety in weight, appearance, and damage; and other categories usually have standard weights and shuffled appearances (scrolls, potions, spellbooks, rings, wands) so the only sensible sort order is by price or maybe alphabetical.
I hand-modified the Gem table because it has been hand-modified since your original code, which didn't list both "blue" and "green" as possible turquoise appearances. I don't fancy coding that into the generator so I think I'll just leave it. Rhebus 14:11, September 2, 2009 (UTC)