The Standardista Table Sort script allows the user to sort tables in your WebHelp outputs.
(I've only tried it in WebHelp, it'll probably work in HTML Help and DotNetHelp too.)
It doesn't require too much effort; all you have to do is add some script files to your project, and any tables (of a particular class) can be sorted by the user in the output. It will also work for Flare table stylesheets, with a minor change to one of the scripts.
It works pretty well, and only sorts the table body - the header and footer remain ok.
You can download the script here:
http://www.workingwith.me.uk/articles/s ... le_sorting
Set up the script files in your project
1. Copy the three js files into your project: standardista-table-sorting, css.js, common.js.
2. Add links to these files in the head section of a master page; in this example I've put the scripts in the folder Resources/Scripts, so the links from the MasterPages folder are:
Code: Select all
<script src="../Scripts/common.js" />
<script src="../Scripts/css.js" />
<script src="../Scripts/standardista-table-sorting.js" />
Make your tables sortable
(A) If you don't want to use a Flare table stylesheet, then just assign the class sortable to your tables. The script will automatically make any table sortable that has the class table.sortable.
(B) If you do want to use a Flare table stylesheet, then modify the script file standardista-table-sorting.js.
Find the following line:
Code: Select all
if (css.elementHasClass(thisTable, 'sortable')) {
Code: Select all
if (css.elementHasClass(thisTable, 'TableStyle_MyTable')) {