Small Table Sorting Component In Vanilla JavaScript

Category: Javascript , Table | July 19, 2018
Author: tristen
Views Total: 3,240 views
Official Page: Go to website
Last Update: July 19, 2018
License: MIT


Small Table Sorting Component In Vanilla JavaScript


A small table sorting component written in pure vanilla JavaScript that supports various sort types defined in individual JS files.

Basic usage:

Include the core JavaScript in the web page.


Include the sort type JavaScript files as you need.

<script src=""></script>
<script src="tablesort.dotsep.js"></script>
<script src="tablesort.filesize.js"></script>
<script src="tablesort.numeric.js"></script>

Enable the table sorting on an Html table.

new Tablesort(document.getElementById('table-id'));

You can pass the descending option to specify the Ascending/Descending order.

new Tablesort(document.getElementById('table-id'), {
  descending: true



  • v5.0.2

You Might Be Interested In:

Leave a Reply