title: Django template cycle for alternating rows - without loop
body: <p>Perhaps this is a non-question, but how do you make use of the Django <code>{% cycle %}</code> functionality, or something similar, when you're not in a loop? Specifically, I have an HTML table that I'm writing by hand, since it's not the sort of thing you need to do in a loop. I want the rows to alternate, like this:</p>
  
  <pre><code>   &lt;tr class="{% cycle 'even' 'odd'%}"&gt;&lt;/tr&gt;
     &lt;tr class="{% cycle 'even' 'odd'%}"&gt;&lt;/tr&gt;
     &lt;tr class="{% cycle 'even' 'odd'%}"&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>But I'm not using  a loop, so this always results in <code>even</code>. I don't want a situation where I want to insert one row later, and then have to change the classes of all rows beneath it by hand. Am I just being petty? How would you cycle without being in a loop?</p>