Ripoff and update of the sorttable from http://www.kryogenix.org/code/browser/sorttable/ by Stuart Langridge
This is a cleaner one without polyfill and updates for DOM manipulations
This code is interesting as plain vanilla and nearly clean. It needs more a little modernization yet.
I correct and publish it in the same original MIT licence, as in http://www.kryogenix.org/code/browser/licence.html
Insert the lib loader at you convenience. Classic HTML would put it like that in the <head>
tag :
<script src="./libs/sorttable.js"></script>
To have a <table>
sortable :
- add a
sortable
class to it - You must have a
<thead>
and a<tbody>
sections - in JS, call
sorttable.init()
or more specificallysorttable.makeSortable(table_element)