Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

preserve zebra striping with jquery tablesorter plugin

The table on this page is sorted by the tablesorter plugin. The candy-striping is not re-applied after sorting, so the shaded and unshaded rows appear in the wrong sequence after a sort is performed. Click on the Name column to see an example of this.

Is there a way to redo the striping after a sort?

like image 356
Dónal Avatar asked Dec 01 '25 08:12

Dónal


1 Answers

You have to use the zebra widget. Use the following piece of code to initialize the tablesorter:

$("table.tablesorter").tablesorter({
    widgets: ['zebra']
});

Zebra is the only widget included by default. See here for reference.

like image 142
Joseph Silber Avatar answered Dec 03 '25 22:12

Joseph Silber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!