Small Table Sorting Component In Vanilla JavaScript

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

Preview:

Small Table Sorting Component In Vanilla JavaScript

Description:

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.

tablesort.js

Include the sort type JavaScript files as you need.

<script src="tablesort.date.js"></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
});

Changelog:

07/19/2018

  • v5.0.2

You Might Be Interested In:


Leave a Reply