【发布时间】:2017-08-08 21:28:53
【问题描述】:
我正在使用 Django Web 框架,并且我有一个 html 表,其中显示了我的一个表中的一些字段。如果没有要显示的字段(查询集中的记录),我从 python 传递 variable = "0"。
在这种情况下,我想将文本附加到表格中,以便它出现在在我的表格下方。但它出现在我的桌子上方......
<div class="1" style="overflow-x:auto;">
<table id="1" class="1">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
{% ifequal variable "0" %}
<p>No items to show</p>
{% else %}
<--append some fields-->
{% endifnotequal %}
</table>
</div>
如果我添加的字段可以正常工作,它们会按预期显示,但在其他情况下,它会添加到表格上方...
为什么?救命!
【问题讨论】: