sortable

The simplest, most elegant way to sort a table.

0.8.0

Sortable

Sortable is an open-source JavaScript and CSS library which adds sorting functionality to tables. It is tiny (<2kb min+gzip) and has no dependencies.

Demo

Here is a demo of the “Bootstrap” theme.

Browser Usage Initial release Stable version
Chrome 42.68% September 2, 2008 31.0.1650.57
Internet Explorer 25.44% August 16, 1995 11.0.1
Firefox 20.01% September 23, 2002 25.0.1
Safari 8.39% January 7, 2003 7.0
Opera 1.03% Late 1994 18.0.1284.49
Other 2.44%

Install with Eager

The easiest way to add Sortable to your site is with Eager. Click Install to see a live preview of Sortable on your website.

Features

  • Drop-in script and styles
  • 6 beautiful CSS themes
  • Tiny footprint (<2kb min+gzip) and no dependencies
  • Looks and behaves great on mobile devices

Requirements

  • None

Browser Support

  • IE8+
  • Firefox 4+
  • Current WebKit (Chrome, Safari)
  • Opera

Manually Including

For the most common usage of sortable, you’ll want to include following:

<script src="sortable.min.js"></script>
<link rel="stylesheet" href="sortable-theme-bootstrap.css" />

Now any table with the attribute sortable will be made sortable. To get the styling, you’ll also need to add a class name to the table to match the theme you chose:

<table class="sortable-theme-bootstrap" data-sortable>
    <!-- ... -->
</table>

This example uses the “Bootstrap” theme. If the tables on your site already have styling, you may want to try the “Minimal” theme instead. For a full list of supported themes, check out Themes.

Learn More

To learn more about how to use sortable, visit our API pages.

Credits

Sortable is free and open-source, released on the MIT License.

Credits

Sortable was built by Adam Schwartz