A lightweight javascript table sorter
JavaScript CoffeeScript CSS
Switch branches/tags
Nothing to show


Lightweight javascript table sorter

Made for an internal tool, I didn't try to make it crossbrowser.

You don't need any library to use it. It's just javascript.

Here is a simple implementation demo and here is a playground.

How to use it?

Installation is very simple. Just add the script at the end of your html (just before </body>) and then call the init function:

<script src="light-table-sorter.min.js"></script>
<script> LightTableSorter.init() </script>

You just need to respect this table structure:


Classes and style

Some classes are added when you click on a th element. asc for ascending sorting and desc for descendant sorting.

You can style your table the way you want. You also can take inspiration from my own ;-)

That's all folks!