Tablesorter zebra widget breaks sortability

Go To


I have put this code together to create a table, but when I include the zebra widget - I can only sort the columns to descend. I cannot make the ascend or bring them back to normal, however the zebra widget works :D

Is there anything wrong with my code here? Thanks :)

    $(document).ready(function() { 


         widgets: ['zebra','repeatHeaders'] 

Edit: I also tried changing 'table' to '#myTable'.

2011-10-20 13:36
by pufAmuf


Why do you open it twice?

It should be

$(function() {      
    $("#myTable").tablesorter({widgets: ['zebra']});
2011-10-20 13:41
by Marco Johannesen
Hmmm, I don't know why it never occurred to me. Thanks Marco : - pufAmuf 2011-10-20 13:45
Heheh... Anytime : - Marco Johannesen 2011-10-20 14:21


You will need to add the widget in as described here and then call it like so:

        // Sort Specific Table //

        // Sort Specific Table and Add Zebra to it only //
        $('#myTable').tablesorter({widgets: ['zebra','repeatHeaders']});

        // Add Zebra Plugin to All Tables //    
            widgets: ['zebra','repeatHeaders'] 
2011-10-20 13:43
by dSquared