https://www.kryogenix.org/code/browser/sorttable/
Current Version: SortTable version 2, 7th April 2007
To make a table of your choice sortable, there are two steps:
<script src="/Javascript/SortTable/sorttable.js" type="text/javascript"></script>
<table class="sortable">Note that the library's JavaScript file is called sorttable (two Ts), but the class you add to the table is sortable (one T).
And that's all you need. Your table will now have column sorting available by clicking the headers. To make the feature more visible to the user, you might want to add the following styles to your local.css stylesheet, or make up some of your own based on this:
/* Sortable tables */ table.sortable thead { background-color:#eee; color:#666666; font-weight: bold; cursor: default; }