Blog Archive for March 15, 2010

jQuery Tablesorter and Decimals

March 15, 2010

I had a situation where I needed the tablesorter plugin to work with decimal numbers, where the first number was (probably) static, and the second increased. The ordering I needed was 17.1->17.9, then 17.10->17.20 etc.

Here's the javascript to use this for the sorting on the first column of my …

jQuery Tablesorter and Dates

March 15, 2010

I'm using the tablesorter from http://www.tablesorter.com, which is a jQuery plugin which supports re-ordering table rows by sorting on the data in them. Unfortunately, this doesn't work well with dates.

31-01-2000 Format

To sort dates in this simple format, use the following:

$(document).ready(function …