Semi Protection

UESPWiki:Archive/CP Sortable Tables

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search
This is an archive of past UESPWiki:Community Portal discussions. Do not edit the contents of this page, except for maintenance such as updating links.

Sortable Tables

I've made some updates to how sortable tables work, adding some new useful features. The changes are documented at Help:Tables#Sortable Tables. To see the changes you'll probably need to hard refresh (Ctrl-F5) your browser window. If you notice any sortable tables that are broken by the updates, let me know. Or let me know if there are problems with the new features, or requests for other tweaks (not guaranteeing they'll be doable, but you can always ask). --NepheleTalk 02:11, 25 June 2008 (EDT)

Sweet! Did you get this code from somewhere or write it yourself? If you wrote it, you should let the Mediawiki people know - there's some pretty good improvements there I think they'd be interested in. (I put in a request for descending sort on their page months ago, and never got a response. I was really surprised that feature wasn't included by default.) As for the changes to Morrowind:Merchant List, I guess the letters instead of icons are a reasonable compromise, if that's what's needed to make the page viewable again. It's too bad you can't do something equivalent to the "Freeze Panes" feature in Excel. Having a header column that stays visible on the top while the rest of the contents scroll below it would be REALLY useful, but I can imagine how that would be tricky to code in a wiki. (Though maybe possible - If you think that just about every browser-accessed e-mail site manages to do something like that, I wonder if something along those lines would do the trick - but it's probably not worth the effort.) Another tweak that would be nice is some way of dictating the format of an entire column by choosing a class in the header cell. You can do it easily with rows, but not columns. A good example where this would be handy would be the colored columns on Morrowind:Spell Merchants. If you could just set something once on the first cell and have it carry all the way down the column instead of treating every cell individually, this page would load MUCH faster, I think. Assuming it's possible, which I'll leave to your judgement, of course. Anyhow, nice work there. --TheRealLurlock Talk 02:37, 25 June 2008 (EDT)
The code updates are mine; I put them together a while back for my "real" job and finally took the time today to port them over to the wiki. Some day here I'll get around to sharing my wisdom with the Mediawiki developers :P
Setting properties for an entire column in a table is basically just not possible with HTML. HTML doesn't have a concept of columns, only rows and cells. The code I've put together for the sortable tables starts to simulate columns, but this code is all javascript-based. In other words, if we wanted to pursue column formatting, the formatting would only be available to readers with javascript-enabled browsers (OK, that's probably most everyone today, except perhaps security-paranoid people). And it wouldn't really make the page load that much faster. The HTML would be a bit smaller, but our performance problems come from images and templates, not from raw HTML. Then once the page gets to your browser, there'd be an additional delay added as the javascript processes the page--effectively just adding the missing HTML back in. --NepheleTalk 04:16, 25 June 2008 (EDT)