jQuery tablesorter alternate rows problem

Hi.
Server side I build a table with the usual
two classes odd and even.
When I put the tablesorter plug in according
to the sort give to the data
this classes don’t follow the alternate
order (odd even) with an ugly lay out :frowning:
Is there a way to work out the problem
by the tablesorter script ?

Bye.

You could add this into the script:


$('table tr:even').css({background:'white'});
$('table tr:odd').css({background:'gray'})

Smart point :wink:
but it’s the same result
all the classes mix-up :frowning:


$("#list-all").tablesorter({
         headers: {7:{sorter: false}
        }
    });
$('table tr:even').css({background:'white'});
$('table tr:odd').css({background:'gray'});

I think it’s available as a widget of the plugin. If you look here: http://tablesorter.com/docs/ - you’ll see that the first example table has alternate class rows. If you look at the source where the $.tablesorter plugin is called, a widget is specified in one of the options as “zebra” - I’m assuming this is what initiates the gray/white alternating TRs.

At the same time :wink:
Thanks for the help I worked out with:


$("#list-all").tablesorter({
		widgets: ['zebra'],
         headers: {7:{sorter: false}
		}
    });

and it keeps the same colour I put
in the css file.
Bye.