最近做个页面的时候需要这个,本以为必须要用js了,没想到竟然还找到一个css的方法.
记录一下,以后也许用得着
<style>
tr{ background: #f00;}
tr:nth-child(2n){ background: #ccc;}
tr{ background-color: expression((this.sectionRowIndex % 2 == 0) ? "#f00" : "#ccc" );}
</style>
Recommended searches
Top trending

最近做个页面的时候需要这个,本以为必须要用js了,没想到竟然还找到一个css的方法.
记录一下,以后也许用得着
<style>
tr{ background: #f00;}
tr:nth-child(2n){ background: #ccc;}
tr{ background-color: expression((this.sectionRowIndex % 2 == 0) ? "#f00" : "#ccc" );}
</style>
发表回复