Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/duzun/jquery.tablesortable
- Owner: duzun
- License: mit
- Created: 2020-11-21T19:35:28.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-21T21:17:53.000Z (about 4 years ago)
- Last Synced: 2024-11-20T05:10:07.111Z (about 2 months ago)
- Topics: jquery, sort, sortable, table
- Language: TypeScript
- Homepage:
- Size: 33.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)