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

后端 未结 5 1520
情话喂你
情话喂你 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:35

    (In CSS <= 2) Nope. Unfortunately there aren't any selectors (in CSS <= 2) that operate based on the position (in terms of the number it is within it's parent's children) which I believe you would need to do this with just CSS.

    Note to self: read up on CSS3, already!

提交回复
热议问题