Table Sort

At a glance... * Plays nicely with the JavaScript global namespace (the script creates and reuses only one JavaScript object) * The new script sorts (on average - based on my very non-scientific calculations), 5 times faster than its predecessor * The plug-in architecture makes writing custom sort functions a breeze * The script can now highlight both alternate rows and full columns on a table by table basis. * Like its predecessor, the script is fully keyboard accessible * The script can correctly determine a columns datatype should a datatype not be explicitly defined * The script is smart enough not to sort columns containing identical data * Sort routines can now be initiated using JavaScript * Tables can be automatically sorted on a column of your choice * Before-sort and after-sort callback functions can now be defined for individual tables * The script can now "reverse sort" onload (thanks to Parag)

Table Sort demo

Changes to the code below will update the demo above in real time.



June 18, 2007, 10:34 p.m. - orxkfggyzz

Hello! Good Site! Thanks you! drdrqngnqdrt

Sept. 15, 2007, 6:27 a.m. - DB

Hi, TableSort looks really good. Is there a way of re-ranking each row after sorting using another column, Like Table Organize does?

Oct. 6, 2007, 12:27 a.m. - boxer dog sale

I have just found an interesting forum on this theme

Jan. 4, 2008, 7:01 a.m. - marauder

sort by rank doesnt work

Jan. 25, 2008, 9:28 a.m. - Óskar

This is a great script :) Only I have a question about non-english characters, is there a way to enable unicode or whatever it is called :)

July 17, 2008, 12:50 p.m. - Vish

Thanks for woderful script

Sept. 1, 2008, 12:26 p.m. - Adriaan Nel

The rank column doesn't sort correctly, I get it in this order: 3,1,11,36,14,37,46,33 It's really really bad if the provided demo doesn't work as expected...

Sept. 19, 2008, 8:35 a.m. - Ryan Couser

Rank column will work correctly if you change the to numeric like so class="sortable-numeric fd-column-0">

Nov. 20, 2008, 5:15 p.m. - Goege

I love this sortable table script. Thank you very much.

Nov. 21, 2008, 11:28 a.m. - captain obvious

Oh, by the way, Sort by rank isn't working!

Nov. 25, 2008, 7:48 a.m. - Dan

Rank column is set to sortable-keep. I didn't look into the javascript but i think the example works as intended (it keeps the rank)

Jan. 2, 2009, 3:50 a.m. - edo_infokom@yahoo.com

that's was great

April 21, 2009, 2 a.m. - bassuhg

Thank you for the script cheers :)

June 2, 2009, 3:09 a.m. - banmaixanh_812@yahoo.com

oh yeah! very good!

June 19, 2009, 2:05 a.m. - fern

nice script..:-)...but it would be better if null values should always stay on the table bottom when sorted...

June 20, 2009, 12:19 a.m. - fern

hi..i'm having a problem in sorting..i didn't find other sorttable script to 'not to sort null values/blank cell'...i mean i want rows with null values to always stay at the table bottom when sorted... thanks for the great script..

Aug. 17, 2009, 2:28 a.m. - lea

How i do a selectable rows and sortable table at the same time. I won't to have table wich have sortable id and selectable rows

March 11, 2010, 10:15 a.m. - chip

testing sort

March 23, 2010, 3:23 a.m. - Skids

Thank you sooooo much!! I have been struggling with sorting multi-dimensionaly arrays in PHP to display numerous scoring tables, but with this JS I can now load the table and then sort it instantly without worrying about the code. The sorting on columns is a bonus too! Respect!

May 19, 2010, 3:56 a.m. - Anonym

how to specify were the sortable column begins

June 10, 2010, 12:35 a.m. - Kinjal solanki

Its a fantastic code and output also.. Mindblowing.. Kinjal Solanki Kinjal.mis@gmail.com MIS Coordinator District Watershed Development Unit, Patan

Feb. 3, 2011, 12:05 p.m. - David Toombs

Great Script, however numeric data doesn't sort correctly for me, sorts as text. This is the second table sort script I've tried so it must be my table but I cant think what the problem is. My table is derived from a MySQL query and the original data is numeric in the MySQL table. Any one spot what I'm doing wrong ?

March 14, 2011, 9:38 a.m. - mahesh

this is used to table sorting

Nov. 29, 2011, 10:25 a.m. - Donny

hi, how about unsorted column like index / row number (1,2,3,4,5)? index shold not be shorten. thanx

Nov. 29, 2011, 7:20 p.m. - Mike

What does reverseSort do?

Jan. 13, 2012, 3:43 p.m. - sujttha

oik. good one.

Feb. 28, 2012, 5:14 a.m. - dr. d

very useful............