【问题标题】:Jinja2 Strange template behaviourJinja2 奇怪的模板行为
【发布时间】:2017-04-25 13:59:26
【问题描述】:

我正在使用引导 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

【问题讨论】:

    标签: python flask jinja2


    【解决方案1】:

    我没有关闭 &lt;table&gt; 标记。当我修复它时,它的行为正常。

    【讨论】:

      猜你喜欢
      • 2011-08-06
      • 2023-03-26
      • 1970-01-01
      • 1970-01-01
      • 2011-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多