views:

201

answers:

2

Is there a jquery function to sort a table. I am aware of the JQuery Tablesorter plugin but I want to avoid using it if possible.

As a FYI - The table that I have a header with custom images to indicate ascending and descending. The data type could be pretty much any type.

EDIT:Can I do sorting of a table in Javascript?

+1  A: 

Is there a design requirement that prevents you from using third party software in your web application? If not, why would you want to develop your own solution to a problem that has been solved and vetted by many other developers?

jakemcgraw
+1 I don't mean to offend the original poster but if you're capable of writing this yourself, then you should be capable of figuring out how the Tablesorter plugin accomplishes it. If not, use Tablesorter.
Ken Browning
+1  A: 

Javascript guru Stuart Langridge has a nice alternative to using jQuery called tablesorter.js

http://www.kryogenix.org/code/browser/sorttable/

I've used it before; works great and it's pretty lightweight.

Chris Tek