Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

Tablesorter JS

11 sites No security coverage
View on drupal.org

This module adds client-side sorting functionality to tables on your Drupal site, allowing users to click on column headers to sort the data without a page reload. It's designed to be lightweight and compatible with jQuery 4 for Drupal 11 and later.

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
5 months ago
Releases (12 mo)
5 ▲ from 0
Maintenance
Active

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