a3ada0bf354133efa3e929e3f4475cd8149d287c
[django-tables2.git] / django_tables / templates / django_tables / basic_table.html
1 {% spaceless %}
2 <table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
3     <thead>
4         <tr class="{% cycle "odd" "even" %}">
5         {% for column in table.columns %}
6             <th>{{ column.header }}</th>
7         {% endfor %}
8         </tr>
9     </thead>
10     <tbody>
11         {% for row in table.rows %}
12         <tr class="{% cycle "odd" "even" %}">
13             {% for value in row %}
14                 <td>{{ value }}</td>
15             {% endfor %}
16         </tr>
17                 {% empty %}
18                 {% if table.empty_text %}
19                 <tr><td colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr>
20                 {% endif %}
21         {% endfor %}
22     </tbody>
23 </table>
24 {% endspaceless %}