How do I zebra stripe a datalist in asp.net

I have a datalist populated by a dataset.  I'd like to zebra stripe it using only vb, or css.

How do I do this?
UnderSevenAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
käµfm³d 👽Connect With a Mentor Commented:
Give each alternating row its own class (e.g. even/odd). Add a CSS rule for each class that specifies the color you want each stripe to be. In your VB code you simply need to add logic that applies each class to every other row. You can look into handling the ItemDataBound event to accomplish this action.
0
 
UnderSevenAuthor Commented:
I even had a itemdatabound event already coded for another purpose.
0
All Courses

From novice to tech pro — start learning today.