A stupidly small and simple jQuery table sorter plugin
This is a stupidly simple, absurdly lightweight jQuery table sorting plugin.
$ bower install jquery-stupid-table
Most table sorting plugins try to account for a limitless number of data types and their limitless ways of being presented. This leads to an extremely bloated code base with only a tiny portion of the code ever used by your project.
This plugin avoids that issue by letting you define your own ways of sorting table columns. The plugin internally recognizes "int", "string", "string-ins" (case-insensitive) and "float", so simple data tables will take very little effort on your part. See the README for more details.
Here's a simple example. Click a header to sort the table by that column.
int | float | string |
---|---|---|
15 | -.18 | banana |
95 | 36 | coke |
2 | -152.5 | apple |
-53 | 88.5 | zebra |
195 | -858 | orange |
$("#simpleTable").stupidtable();
And the following HTML
<table id="simpleTable">
<thead>
<tr>
<th data-sort="int">int</th>
<th data-sort="float">float</th>
<th data-sort="string">string</th>
</tr>
</thead>
<tbody>
...
... (rest of the table)
View the README for full documentation.