Method 1: The Cross-Browser CSS Way
The easiest way to do this is to make use of the built-in Django {% cycle %}
tag. Here’s how to use it for a table containing blog entries:
1 | <table> |
Method 2: The Pure CSS Way
1 | tbody tr:nth-child(even) td {background: #bbeebb;} |