A minimal Javascript library that makes table columns sortable.


Just add the script and, optionally, the CSS link to the page header. Then add the class sortable to any table that shall be sortable.

    <link rel="stylesheet" href="/css/tablesort.css">
    <script type="text/javascript" src="/js/tablesort.js"></script>
    <table class="sortable">

Clicking on a header cell sorts all table rows in ascending order, based on the values in the corresponding column. Clicking again reverses the sort order. If two cells in the sort column have the same value, their rows will be sorted based on the previously sorted column.