django template to populate bootstrap rows and columns

后端 未结 5 619
温柔的废话
温柔的废话 2020-12-05 01:14

So here\'s my problem: I\'ve got a bunch of instances of a class. I would like to have a sort of table of these instance objects, so that there is a maximum of six in every

5条回答
  •  广开言路
    2020-12-05 02:09

    Have no time to explain, but I've had similar problem and until i closed this browser page here is a solution

    {% for sub_article in articles %}
        {% if forloop.first %}
    {% endif %} {% if forloop.counter|divisibleby:3 %}
    {% endif %} {% if forloop.last %}
    {% endif %} {% endfor %}

提交回复
热议问题