【发布时间】:2016-03-14 03:58:49
【问题描述】:
我想 for 循环我的数据以呈现表格
my datas = [[1, 'count'], [2, 'count'], [3, 'count'], ..., ['total', 'count']]
继续本月的日子
我想像这样将我的数据呈现到表格中 所以当 for 循环计数器到 9 时,它将创建/移动到另一列并继续渲染数据。
我试过这个,但它是水平的:
<table class="table table-bordered table-striped">
<tr>
{%for item in new_client_dict %}
<td>{{ item.0 }}</td>
<td>{{ item.1 }}</td>
{%if forloop.counter|divisibleby:"9"%}
</tr>
<tr>
{%endif%}
{%endfor%}
</tr>
</table>
【问题讨论】:
标签: python html django twitter-bootstrap