html文書の4番目の子要素ごとにhr要素を追加します。これは私が今まで持っているものです:django 1.10サイクルで4番目の要素ごとにhrタグを追加する
<div class="row blog-post">
{% for obj in object_list %}
<div class="col-sm-3">
<div class="thumbnail">
{% if obj.image %}
<img src="{{ obj.image.url }}" class="img-responsive"/>
{% endif %}
<div class="caption post-detail-item">
{% if obj.draft %}<h3>Staff only: <span style="color:red;">Draft</span></h3> {% endif %} {% if obj.publish > today %}<h3>Staff only: <span style="color:red;">Future Post</span></h3>{% endif %}
<h3><a href='{{ obj.get_absolute_url }}'>{{ obj.title }}</a><small> {{ obj.publish|timesince }}</small></h3>
{% if obj.user.get_full_name %}
<p>Author: {{ obj.user.get_full_name }}</p>
{% endif %}
{{ obj.get_markdown|truncatechars_html:350 }}
<p><a href="{{ obj.get_absolute_url }}" class="btn btn-primary" type="button">View</a></p>
</div>
</div>
</div>
{% cycle "" "<div class='col-sm-12'><hr/></div></div><div></div><div class='row'>" %}
{% endfor %}
</div>
サイクルビットは2番目の要素すべてを分けるように働いていますが、4番目になるようにします。それがなければ、私は1行に4要素を得る。これは私が欲しいものです。基本的に、私は列当たりの標準的な高さを作ることを試みています。 divisiblebyについて