Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/duzun/jquery.tablesortable

A jQuery Plugin to make a table sortable by clicking header cells
https://github.com/duzun/jquery.tablesortable

jquery sort sortable table

Last synced: about 2 months ago
JSON representation

A jQuery Plugin to make a table sortable by clicking header cells

Awesome Lists containing this project

README

        

# jquery.tableSortable

Makes a table sortable by clicking header cells.

Supports tables with `colSpan` & `rowSpan`.

## Usage

Import it after jQuery:

```html

```

```js
$('table#myTable').tableSortable();

// custom comparison function
$('table#myTable').tableSortable({ cmp: (a,b) => a < b ? -1 : 1 });
```

Sample HTML:

```html



Nr.
Name
Order


number
text




1.
Nikola
2
Tesla


2.
John
0
Miller


3.
Jacque
1
Fresco

```

[Demo](https://duzun.github.io/jquery.tableSortable)