1
我正在FLASK中使用對象數組製作表格。我想在每個表格行顯示4個對象,但batch(4)
命令似乎沒有正常工作。它運行,沒有錯誤。但是什麼都不顯示。燒瓶每個表格行4個項目
<table class="Fruits_n_Veggies">
{% for item in fruit | batch(4) %}
{% if item.name %}
<tr>
<td class = "img"> <img src="{{ url_for('static', filename=item.img_url) }}" height="100"; width="100"><br>
{{ item.name }} {{ item.price_min }} - {{ item.price_max }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
我很感謝在這件事上的任何幫助。