views:

35

answers:

3

I have an asp.net GridView that I use the tablesorter on:

  $(document).ready(function() {
     $("[id$='_myGridView']").tablesorter({ sortList: [[0, 0]] });
  }); 

How can I apply zebra striping that re-stripes when re-sorting?

Edit: As @Chetan Sastry pointed out, it's as simple as:

  $(document).ready(function() {
     $("[id$='_myGridView']").tablesorter({ sortList: [[0, 0]], widgets: ['zebra'] });
  }); 
+1  A: 

Have you seen the zebra widget in tablesorter plugin? This says it is part of plugin core - http://tablesorter.com/docs/example-widgets.html

Chetan Sastry
I knew there had to be an easy way to do it...
chris
A: 

It looks like .tablesorter() applies classes of odd and even on the rows of your table. The CSS rule from the Tablesorter webpage is:

table.tablesorter tbody tr.odd td { background-color: #F0F0F6 }
awayken
A: 

Can you try these.

http://docs.jquery.com/Tutorials:Zebra_Striping_Made_Easy

zod