jQuery Table Zebra Striping with hidden rows

故事扮演 提交于 2019-12-11 03:25:21

问题


I have been using the following with no problems:

$("#tableid tr:even").addClass("evenClass");

But now I have rows in my table that are hidden which messes up the zebra striping styles. I have tried add 'is(":visible")' and things like that to no avail. Any ideas?


回答1:


Try adding the :visible pseudo-selector:

$("#tableid tr:visible:even").addClass("evenClass");

Demo: http://jsfiddle.net/gRyFx/1/



来源:https://stackoverflow.com/questions/3586751/jquery-table-zebra-striping-with-hidden-rows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!