Oh, sometimes I really LOVE the web 2.0 javascript features. Take for example sorting tables. Now the old school method of doing this is to programatically send the column you want to sort by and whether you will be sorting ascending or descending and pass it to the page in a get variable. It is really a pain in the butt to code.

Well, thanks to Stuart Langridge, making tables sortable is a breeze. And it doesn’t require you do a page refresh to sort the table.

The downside is that it doesn’t work on browsers that don’t support Javascript, but unless you are trying to support pocket pc’s or something, this is pretty much a non-issue.

* One thing to watch out for, notice the name of the javascript file is sorttable.js (extra ‘t’ – the script makes a “sort-table”) and the class you need for your table is “sortable” (no extra ‘t’ – the table is now “sortable”). I sort (no pun intended) of missed this and it had me boggled for couple minutes.