Drupal is a registered trademark of Dries Buytaert

tablesorter_js

5 sites No security coverage
View on drupal.org

A lightweight, jQuery 4 compatible client-side table sorting module for Drupal 11+. Add class "tablesorter" to any table to enable click-to-sort on column headers.

Motivation

The Tablesorter module uses the Mottie tablesorter library, which is not compatible with jQuery 4. Drupal 11 ships with jQuery 4, causing JavaScript errors.

The Mottie library uses .bind() and .unbind() methods (~100+ instances) which were removed in jQuery 4. The maintainer stated they would keep using deprecated methods for backwards compatibility. See issue #3517103.

This module provides a simple replacement (~70 lines) covering core sorting functionality.

When to Use This Module

Use when you have:

  • Small to medium tables displayed entirely on the page
  • Static content that doesn't need database queries on sort
  • Simple sorting needs (text and numeric columns)

Do NOT use when you have:

  • Large datasets with thousands of rows
  • Paged tables where sorting should re-query the database
  • Complex needs (custom parsers, multi-column sort, filters)

For server-side sorting, use Drupal core's TableSort.

Features

  • Client-side sorting - no page reload
  • Automatic numeric vs text detection
  • Handles currency ($1,234.56) and percentages
  • Keyboard accessible (Enter/Space)
  • ARIA attributes for screen readers
  • Automatic zebra striping (odd/even classes)
  • jQuery 4 compatible (Drupal 11+)
  • ~70 lines of code

Post-Installation

Add class tablesorter to any table with a <thead>. Works automatically with Tablefield's "sortable" option.

Additional Requirements

None. Uses only Drupal core libraries (jQuery, Drupal, once).

Similar projects

  • Tablesorter - Uses Mottie library, not jQuery 4 compatible
  • DataTables - Full-featured but heavier; not yet Drupal 11 compatible
  • Drupal core TableSort - Server-side only (page reload)

Activity

Total releases
5
First release
Jan 2026
Latest release
3 weeks ago
Release cadence
9 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-rc5 Pre-release Feb 9, 2026
1.0.0-rc4 Pre-release Jan 21, 2026
1.0.0-rc3 Pre-release Jan 13, 2026
1.0.0-rc2 Pre-release Jan 6, 2026
1.0.0-rc1 Pre-release Jan 6, 2026