HTML tables really grind my gears. Considering the nightmare of nested elements and semantic markup, tables aren’t much of an improvement over cuneiform tablets. And to do anything useful with the data—even just reordering it—you have to copy and paste it into a spreadsheet.
Unfortunately, browsers don’t natively support table sorting or filtering. Instead, you have to go back to the data source and re-run queries with ORDER BY / WHERE clauses. AJAX can make it appear seamless, but you’re still making unnecessary server requests.
Here’s a live demo along with source:
Sortable comes with six pre-built css themes, can be initialized on-demand for dynamically generated tables, automatically recognizes alpha vs. numeric data, and works great on mobile. Now go and give your tables some ‘zazz!
Join the discussion