Javascript to Sort a Table

Just the other day my client wanted to have the ability to sort a
column of data. I could have spent some time writing some custom
server-side code using ColdFusion but I figured someone else probably
had a solution I could use.Sure enough, You can include a simple javascript file called http://www.cfblogs.com/vincecollins/TableSort/sorttable.js
and then just insert the class in the table tag.

<table class=”sortable” id=”unique_id”>

I tried it on a table of data from my cfblogs.com site here:

http://www.cfblogs.com/vincecollins/TableSort
Pretty cool eh?

You can ad fancy sorting icons and more by visiting Stuart’s site here:

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

Posted in CFBlogs, HTML, Javascript.

Leave a Reply