Lightweight jQuery Plugin For Sortable Tables - Sortable.js

File Size: 4.32 KB
Views Total: 5033
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Lightweight jQuery Plugin For Sortable Tables - Sortable.js

Sortable.js is a lightweight jQuery script to sort a table column in alphabetical order by clicking the header.

How to use it:

1. Load the jQuery javascript library and jQuery sortable.js in the html document.

<script src=""></script>
<script src="src/jquery.sortable.js"></script>

2. Create a sortable html table following the markup structure like this:

<table class="sortable">
<thead data-header="true">
<th data-sort-column="true">ID</th>
<th data-sort-column="true">Name</th>
<th data-sort-column="true">Last Name</th>
<th data-sort-column="true">Birthday</th>
<th data-sort-column="true">Note</th>
<tbody data-body="true">
<td data-sort-value="1987-12-08">December 8, 1987</td>
<td>Morbi id felis metus</td>
<td data-sort-value="1975-10-14">October 14, 1975</td>
<td>Maecenas id enim vel lectus lobortis molestie</td>
<td data-sort-value="1995-05-05">May 5, 1995</td>
<td>Cras mi purus, dapibus in ipsum a, malesuada facilisis dolor</td>
<td data-sort-value="1967-01-31">January 31, 1967</td>
<td>Aliquam egestas tincidunt purus, a sagittis neque lacinia vehicula</td>
<td data-sort-value="1991-08-17">August 17, 1991</td>
<td>Pellentesque vitae nulla elit</td>

3. Initialize the plugin by calling the sortable() function on your table.

$(function() {

This awesome jQuery plugin is developed by miriti. For more Advanced Usages, please check the demo page or visit the official website.