I'm cycling through a list using {% for item in list %}
and I want to output something like this:
<li>One</li>
<li class='alternate'>Two</li>
<li>Three</li>
<li class='alternate'>Four</li>
...
with the intention of styling the alternate lines a different colour.
Django (1.3) has no mod
or div
template tag operators. I know I can add them by manipulating the django source, but I'd rather not do that as I want to be able to package this app up.
How can I achieve this?