Sorting HTML table

Overview

Want to convert ordinary HTML data tables to sortable ones? Here is what I came up with ... It's easy to do. You just need to include this javascript source and then call initTable function with table ID. If the tables do not have IDs, then you can add them to the HTML table tag (i.e. ID="table0"). You will need to have IE 5.0 or greater or Netscape 6.0 or greater to get this working. I've got three different implementations for you. One uses delete/insertCell to re-draw all the table cells, another uses delete/insertCell for data cells while the other does a direct replacement of the data content of the innermost cell. The first two are slower but more flexible as they will retain all the cell properties while the third is faster but limited as it will only sort the contents of the innermost cells. Anyways ... Since I wrote the script, I have gotten lots and lots of positive feedback/suggestions from all over the place. So, I'd like to say "Thanks" to everyone who has helped me improve the script. If the script is used on public sites, please let me know so that I can have the links available here. Mostly for self-satisfaction :-) Of course, that's if you are willing to share the information ...
 

Sources/Sample

 

Sites using the script

 

Visits

Counter
1