
The third iteration of the TinyTable table sorting script adds search, column averages and totals, record numbering, a view all function, and a reset function. At only 6KB it is still lightweight, quick, and includes all previous TinyTable features. Other features include alternate row highlighting, header class toggling, auto data type recognition, and selective column sorting. If you don’t need the new features take a look at the second version of the script which weighs 2.5KB.
To initialize a table sorter follow the pattern below:
var sorter = new TINY.table.sorter('sorter','table',{
headclass:'head', // Header Class //
ascclass:'asc', // Ascending Class //
descclass:'desc', // Descending Class //
evenclass:'evenrow', // Even Row Class //
oddclass:'oddrow', // Odd Row Class //
evenselclass:'evenselected', // Even Selected Column Class //
oddselclass:'oddselected', // Odd Selected Column Class //
paginate:true, // Paginate? (true or false) //
size:10, // Initial Page Size //
colddid:'columns', // Columns Dropdown ID (optional) //
currentid:'currentpage', // Current Page ID (optional) //
totalid:'totalpages', // Current Page ID (optional) //
startingrecid:'startrecord', // Starting Record ID (optional) //
endingrecid:'endrecord', // Ending Record ID (optional) //
totalrecid:'totalrecords', // Total Records ID (optional) //
hoverid:'selectedrow', // Hover Row ID (optional) //
pageddid:'pagedropdown', // Page Dropdown ID (optional) //
navid:'tablenav', // Table Navigation ID (optional) //
sortcolumn:1, // Index of Initial Column to Sort (optional) //
sortdir:1, // Sort Direction (1 or -1) //
sum:[8], // Index of Columns to Sum (optional) //
avg:[6,7,8,9], // Index of Columns to Average (optional) //
columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}], // Sorted Column Settings (optional) //
init:true // Init Now? (true or false) //
});
The first parameter taken by TINY.table.sorter is the variable name used for the object, the second is the id of the table, and the third is the settings object. You can either initialize the script in the object creation by setting init to true or you can initialize it later using sorter.init().
This script has been tested in all major browsers and is available free of charge for both personal or commercial projects under the creative commons license. Community support is available here. Paid support is also available, contact me for details.
Click here to download the source code.
11/16/2009 – Updated script to function correctly in IE6/IE7.

Pingback: TinyTable v3, la herramienta perfecta para tus tablas : Blogografia
Pingback: CSS Brigit | Advanced JavaScript Table Sorter
Pingback: TinyTable v3, la herramienta perfecta para tus tablas | aNieto2K
Pingback: links for 2009-11-17 | On9 Systems
Pingback: Sortable Table 可排序表格JS收集 | ╭╰Original Colors╯╮ - 认真工作
Pingback: links for 2009-11-17 « riverrun meaghn beta
Pingback: TinyTable v3 - Tabellen mit JavaScript sortieren, durchsuchen, etc. | tagdocs.de
Pingback: links for 2009-11-18 | Yostivanich
Pingback: An Advanced Lightweight JavaScript Table Sorter: TinyTable V3
Pingback: TinyTable V3: Advanced JavaScript Table Sorter || webresources4u.com
Pingback: TinyTable v3 con jQuery Context Menu y Dialog UI «dsite.es
Pingback: Buscar y ordenar texto con acentos en TinyTable v3 «dsite.es
Pingback: Mabufiles » Blog Archive » TinyTable v3, la herramienta perfecta para tus tablas
Pingback: Tweets that mention Advanced JavaScript Table Sorter – TinyTable V3 - Web Development Blog -- Topsy.com
Pingback: Ordenar datos de una tabla con TinyTable | SummArg
Pingback: TinySlideshow « After Zain Sleeps
Pingback: Webmasterkit.info » Free Sortable and Searchable Tables