Skip to content

Instantly share code, notes, and snippets.

@robsmith1776
Created May 3, 2016 20:44
Show Gist options
  • Save robsmith1776/7d3cfb8d1a6351242420d47c2c7f27cf to your computer and use it in GitHub Desktop.
Save robsmith1776/7d3cfb8d1a6351242420d47c2c7f27cf to your computer and use it in GitHub Desktop.
Jinja Table
<div class="table-title">
<table class="table-fill">
<thead>
<tr>
{% for col in table[0] %}
<th>{{ col }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for row in table %}
<tr class="{{ loop.cycle('odd', 'even') }}">
{% set rowloop = loop %}
{% for col in row %}
<td id="cell-{{ rowloop.index }}-{{ loop.index }}">{{ row[col] }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment