Make alternating CSS table row style work in Internet Explorer

后端 未结 3 990
夕颜
夕颜 2020-12-09 11:35

I use this CSS code to display a database output in rows where the colors repeat in every 2nd row

tbody tr:nth-child(2n) td, tbody tr.even td {  
    backgro         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 12:00

    I like the answer above, but alternate row colours doesn't seem to work if a document isn't refreshed.

    Try jQuery too:

    $("tbody tr:even td").css("background-color", "lightgray");
    

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

提交回复
热议问题