With a little side of applesauce...

Wednesday, November 26, 2008

jQuery - tablesorter

Once again, I have found a really cool plugin for jQuery... tablesorter.

It makes table sorting simple. The following excerpt allows one to click table headers, and sorts the table by the second column in ascending order by default:

<script type="text/javascript" src="includes/jquery.tablesorter.min.js"></script> 
<script type="text/javascript">
// Your code goes here
$(document).ready(function()
{
$("table").tablesorter({
sortList: [[1,0]]
});
});
</script>


The following links helped me to get started:
http://www.packtpub.com/article/jquery-table-manipulation-part1
http://motherrussia.polyester.se/docs/tablesorter/

No comments: