Mingyi's FireFox Extension for sorting HTML tables - TableSort
Please note:TableSort FF extension is superceded by another more powerful extension Mingyi created here (named TableTools). Please download and install that one instead!
What can be sorted? - Anything! (well, almost)
A quick demo is below, just press 'ctrl-alt-click' (click is your mouse click) anywhere in the table to sort that column! Also read on for features and more demos!
Please note that US-styled time (or European-styled, based on your chosen preference setting for TableSort), Dollar/Euro/Yen/Pound, Number, Text, IP addresses are automatically recognized. But for other formats, please right click anywhere in the table and choose the appropriate data type for correct sorting.
US time |
European date time |
Y-M-D date & time |
Dollars |
Chinese money |
IP addresses |
Names |
Numbers |
this is footer |
row |
number |
ONE! |
adsf |
adsf |
adsf |
adsf |
Index of this page:
How to install and use the TableSort FF extension
What's new & Version history
Author & feature lists
License
How to install and use the TableSort FF extension
- There are two ways to install it:
- You can always find the latest extension on this page. To install, right click on this link and choose "save link as" to save the tablesort.xpi file onto your hard drive. Then in FireFox go to "File"->"Open" and open tablesort.xpi. After a few seconds, the "install" button becomes clickable, click it and close ALL of your firefox windows. Start firefox up again and the installation is done!
- You can also go to the TableSort on the official FF extension site and install it. There you may not get the latest version however
-
- To use this extension, go to any web page that contains an HTML table (this page offers a good demo for sure). Press down the "ctrl", "alt" keys at the same time, then click anywhere inside that table. After a short while (depending on how big the table is, of course), the table will be sorted on the column you clicked upon.
- If you would like to change the default behavior of this extension, please go to firefox "Tools"->"Extensions", find "TableSort" and double click on it to launch the options menu, and set the menu there.
- Please note that US-styled time (or European-styled, based on your chosen preference setting for TableSort), Dollar/Euro/Yen/Pound, Number, Text, IP addresses are automatically recognized. But for other formats, please right click anywhere in the table and choose the appropriate data type for correct sorting.
- Also note that complex tables with column span will probably be sorted in a way that is not desired, but that is the problem common to all html table sorting javascripts, AFAIK, unfortunately.
That's it! You can now sort pretty much any html tables on the web now! For advanced usage, read on!
Author and feature lists:
This FF extension was converted by Mingyi Liu from Mingyi's powerful cross-browser Javascript listed here. In fact, IMHO, it's the most powerful/feature-rich html table sorting JS on the web.
The extension has these features:
- Ease of use - right click inside table and select context menu options to sort, or just press 'ctrl+alt+mouse click' anywhere in table to activate sorting even faster!
- Fast and accurate sorting and even faster when reversing sorted column.
- Automatically detects date, number, text, currency, IP address and sort them. Auto-detect timestamp (not just date), negative numbers, scientific notations, multiple currencies correctly.
- Allow user to specify column data type explicitly through context menu.
- Provide preference (option) settings such that one could change the default behavior of the extension
- Support multiple tables on same html page.
- Works with thead, tbody, th, etc. html tags. Or even nested tables. Allows multi-row header and footer.
- Tolerates table colspans, although the end sorting results could be funny looking
- Support various levels of style preserving (row-level, cell-level or
table-level (default)). Particularly useful for table rows that're
alternatively highlighted (choose 'row-level' for it, which is default).
Unfortunately, due to the complexity of converting some features (and my laziness), the extension lost these features of the javascript it's based on:
- Cross-browser support.
- Allow user/web page author input a customized date format (like 2006, 09/26).
- Allow user/web page author input a custom sorting function that practically would enable sorting anything they want!
- At time of release, this extension was tested on FF 1.5.0.3 on Windows, 1.0.7, 1.5.0.1, 1.5.0.3 on Linux (through VMware) and worked fine. There was one installation on 1.5.0.1 on Linux failed to work for TableSort 0.1, but I believe it's fixed in TableSort 0.11.
What's new and version history
version 0.11:
- Fixed a bug that caused sorting to be random when the first data cell in the column is empty
- Changed keyboard shortcut from 'alt-click' to 'ctrl-alt-click' (it's because 'alt' alone activates menu after sorting, and 'alt-click' fails to work on FF on Linux)
version 0.1: First release
License:
It's standard FF extension - licenses are (http://www.mozilla.org/MPL/, GPL and LGPL) and no warranty provided (use it at your own risk!) ;)