Sortable Table

Features:

Sort the columns in a table and filter elements in the table.

Usage:

Create a table with a table header <thead>

On each <th> add the attribute axis and specifiy the type of data:

<th axis="string">Firstname</th>

Data types:

Initialise the table:

var myTable = new sortableTable('myTable');

Options:

Filtering:

For the filtering, add a form with a dropdown list with an id of 'column', and a text field with an id of 'keyword'.

Add a submit button and a reset button.

On the form tag, add an on submit which calls the filter within the table object name:

<form id="tableFilter" onsubmit="myTable.filter(this.id); return false;">

Example:

Number of rows:
Filter:
ID Firstname Lastname Experience (Years) DOB