jquery.tablesorter-update
Author: Christian Bach
Update by: Sören
Version: 2.0.5d (changelog)
Licence: Dual licensed under MIT or GPL licenses.
Comments and suggestions can be send to:
Inhalt:
Tablesorter:
Tablesorter is a plugin from Christian Bach for jQuery. I really like it and i added three tiny features that are missing in my point: locale support, UI themes support, support for german date format and decimal points.
Please keep in mind: this should not be a fork from tablesorter, this page will go down if Christian Bach find my contributions good enough to inlude these in the official release!
An Example:
The example from tablesorter.com with german localized data:First Name | Last Name | Age | Total | Discount | Difference | Date |
---|---|---|---|---|---|---|
Peter | Parker | 28 | €9,99 | 20,9% | +12,1 | 06.07.2006 |
John | Hood | 33 | €19,99 | 25% | +12 | 10.12.2002 |
Clark | Kent | 18 | €153,89 | 44% | -26 | 12.01.2003 |
Bruce | Almighty | 45 | €153,19 | 44,7% | +77 | 18.01.2001 |
Bruce | Evans | 22 | €13,19 | 11% | -100,9 | 18.01.2007 |
And with english localized data:
First Name | Last Name | Age | Total | Discount | Difference | Date |
---|---|---|---|---|---|---|
Peter | Parker | 28 | £9.99 | 20.9% | +12.1 | 06/07/2006 |
John | Hood | 33 | £19.99 | 25% | +12 | 10/12/2002 |
Clark | Kent | 18 | £153.89 | 44% | -26 | 12/01/2003 |
Bruce | Almighty | 45 | £153.19 | 44.7% | +77 | 18/01/2001 |
Bruce | Evans | 22 | £13.19 | 11% | -100.9 | 18/01/2007 |
Some HTML:
If you want to use the UI themes you only have to wrap your table in a div:<div id="tableBody"> <table id="myTable"> <thead> <tr> <th>Last Name</th> <th>First Name</th> <th>Email</th> <th>Due</th> <th>Web Site</th> </tr> </thead> <tbody> <tr> <td>Smith</td> <td>John</td> <td>jsmith@gmail.com</td> <td>$50.00</td> <td>http://www.jsmith.com</td> </tr> </tbody> </table> </div>
Additional CSS:
Some additional css is needed to make the table looking nice:div#tableBody { width: 60em; padding: 0.3em; } table { width: 100%; } table th { padding: 0.3em; } table th span { float:right; } table tr.odd { background-color: #FFFFFF; }
Usage:
$(function() { $('#myTable').tablesorter({sortList: [[0,0]], locale: 'de', widgets: ['zebra'], useUI: true}); });
Included locales:
Locale: | Decimal point: | Date point: |
---|---|---|
us | . | / |
en | . | / |
de | , | . |
eu | , | . |
Download:
Here you can download my version for testing, comments are welcome - jquery.tablesorter-update.js
It is based on the latest developer version - jquery.tablesorter-dev.js