Pulling together several of the posts in this discussion, I have managed to come up with a pretty good way of having sortable striped tables that maintain their stripes even after a sort.
Getting all of the code together in one coherent place isn’t my idea of fun, but here’s the general steps I followed to make everything play nice together:
1. Get the sorting library mentioned earlier at: http://ianbicking.org/software/sorttable-ib.js.
2. Get the new stripe function mentioned earlier at: http://davious.org/onepagers/anewstripe.html.
3. Get the CSS class name functions mentioned in this comment: http://alistapart.com/discuss/zebratables/5/#c7078.
5. In the sorting functions, make two changes:
a) In the sortables_init() function, after the table has been made sortable, call the stripe() function, being sure to pass it the table’s ID.
b) In the ts_resortTable() function, call stripe() after all of the changes to the table are complete.
6. In the stripe() function, there are two changes:
a) In the ‘for’ loop, change the increment operation so it increments by one, not two.
b) Instead of appending class names, use the CSS functions (from step 3) to remove the ‘even’ class from the row and then, if the row is an even one (i.e. i % 2 == 0), add the ‘even’ class to the row.
7. In the CSS functions, I removed the first line from the addCSSClass() function, although it’s not necessary.