Skip to content

Instantly share code, notes, and snippets.

@netoisc
Created December 15, 2015 22:22
Show Gist options
  • Select an option

  • Save netoisc/3147ce3ff9c3ce97c960 to your computer and use it in GitHub Desktop.

Select an option

Save netoisc/3147ce3ff9c3ce97c960 to your computer and use it in GitHub Desktop.
How to alternate row style in jinja2
<ul>
{% for row in rows %}
<li class="{{ loop.cycle('odd', 'even') }}">{{ row }}</li>
{% endfor %}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment