How to sort Table OR Grid using jQuery

Sorting is one of the most common feature and with data presented in form of table or Grid, it is a necessary feature. In this post, I will show you how you can sort table or grid using jQuery. It is possible using a jQuery plugin. called "Tablesort".

Tablesort is a small and simple sorting component for tables written in Javascript. It has no dependencies and should have no interference with other libraries.

Features

  • Sort strings
  • Sort numbers
  • Sort currency

How to use it?

To use this plugin, all you need to do is to called "tablesort()" method on table element.

//Code Starts
$('.table').tablesort();
//Code Ends

Feel free to contact me for any help related to jQuery, I will gladly help you.