Jinja2奇怪的模板行为

时间:2017-04-25 13:59:26

标签: python flask jinja2

我正在使用bootstrap CSS并尝试在两个并排的div中添加内容。问题是我将所有内容放入一个div中,交错。

{% if pred_ext != None %}
<div class="col-md-3">
    <h3>Both Teams to Score</h3>
    <h3>{{ pred_ext["BTTS"] }}</h3>
    <h3>{{ pred_ext["noBTTS"] }}</h3>
</div>
{% endif %}

{% if pred_ext != None %}
<div class="col-md-9">
    <h3>Both Over 2.5</h3>
    <h3>{{ pred_ext["over25"] }}</h3>
    <h3>{{ pred_ext["under25"] }}</h3>
</div>
{% endif %}

所有内容最终都在col-md-9 div中。它看起来像:

Both Teams to Score
Both Over 2.5
1.9
2.0
1.2
3.8

1 个答案:

答案 0 :(得分:0)

我没有关闭<table>标签。当我修复它表现正常时。

相关问题