【发布时间】:2017-05-05 16:30:07
【问题描述】:
我正在尝试创建一个简单的页面,该页面应该显示一个表格。 它假设有几行和几列。但并非每一行都应该有相同数量的列。
这是产生错误的我的 html 代码:
<html>
{% for count in machine_count %}
<tr>
<td>{{ count }}</td>
<td>Aufzugmotor</td>
{% for status in statuses %}
{{ status.machine_number}}
{% if count == {{ status.machine_number }} %}
<td class="tableCell">
<img class="imageClass" src={{ status.src }}>
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</html>
statuses 是一个模型,machine_number 是一个字符串元组。
我并没有真正理解我所犯的错误。 难道不能在占位符上使用 if-tag 吗?
【问题讨论】:
标签: python html django parsing if-statement