Built in Tablesorter Formats

September 26, 2010

Using the jQuery tablesorter plugin, there are some built in orderings that you can use. These are often determined automatically, but sometimes (especially when there are blank values) they need to be specified manually.

The formats available are:

  • text
  • digit
  • currency
  • ipAddress
  • url
  • isoDate
  • percent
  • usLongDate
  • shortDate
  • time
  • metadata

To specify, pass in parameters when calling tablesorter(). Column numbers start from zero:

$("#contests").tablesorter({headers:{0: {sorter: 'digit'}, 3: {sorter:  'digit'}, 4: {sorter: 'digit'} }, widgets: ['zebra']});

Tags: jquery tablesorter