开发者

How can I zebra stripe a gridview that uses jquery tablesorter?

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, 开发者_Python百科it's as simple as:

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


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


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 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜