I wrote up a tutorial for my students in Advanced Web Development: Sorting Tables with CSS & jQuery. From the intro:
Tables can be incredibly useful when they are used to display data, but what can be even more useful is the ability to sort the data in the table by columns. On this page we’re going to learn how to sort tables by simply clicking on the column headers. Click once to sort ascending (A-Z) and a second time to sort descending (Z-A).
To perform this magic, we’re going to use tablesorter.js, which builds off of jQuery.
I hope you find it helpful. My plan this summer is to write up about 20 of these one-page tutorials on a variety of subjects, so my students can work through them at their own paces. I think it will be good for everyone.