Sortable

Sortable

Super simple, completely configurable, sortable tables.

View on GitHub

Basic usage

The below example makes the table with the id attribute value of example-1 sortable using the default options and styling provided by the default stylesheet (sortable.css).

sortable('#example-1');

Advanced usage

The below example makes the table with the id attribute value of example-2 sortable and makes use of the options parameter to add custom CSS classes.

sortable('#example-2', {
  buttonClasses: ['btn', 'btn-sm', 'btn-outline-dark', 'w-100'],
  sortedClasses: ['table-light'],
  sortedAscendingClasses: ['text-info'],
  sortedDescendingClasses: ['text-success']
});