Cheesetoast

Brain Food for Web Developers

Table Code

JQuery Tablesorter

Want to improve the functionality of your HTML tables? Tablesorter is “a JQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes”. It is also cross browser friendly, working on IE6+.

To set it up you’ll need to download and include the tablesorter js file (along with a link to the JQuery library). Then simply give your table an id tag like so: <table id=”my_table”> and remember to include both THEAD and TBODY tags. Finally, add the javascipt in your page head:

$(document).ready(function(){

$(‘#my_table’).tablesorter();

}

To download tablesorter and to read the documentation on it, visit the tablesorter website.

 

Author: Graham

My name is Graham and I'm a Scottish web developer living in California. I love working with clean code to make attractive and usable websites. I'm also interested in cooking, gardening, and taekwondo.

Comments are closed.