How to create zebra stripes on html table without using javascript and even/odd classes generation?

后端 未结 5 1517
情话喂你
情话喂你 2020-12-08 01:54

I want to zebra-stripe a html table without using any js stuff or writing server-side code to generate even/odd classes for table rows. Is it ever possible to do using raw c

5条回答
  •  北海茫月
    2020-12-08 02:16

    http://www.w3.org/Style/Examples/007/evenodd CSS 3 nth-child. Since browser support is limited you can reproduce the behavior with Sizzle (included in, jquery for example)

提交回复
热议问题