Stupid-table-plugin

A stupidly small and simple jQuery table sorter plugin

View the Project on GitHub joequery/Stupid-Table-Plugin

Stupid jQuery Table Sort

This is a stupidly simple, absurdly lightweight jQuery table sorting plugin.

Table of Contents

Installation via Bower

  $ bower install jquery-stupid-table

Philosophy

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.

Basic usage

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
This is achieved with the following JS
  $("#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)

More examples

Documentation

View the README for full documentation.