[Answer]-4 Divs that would have to be aligned in the following format with django templates

1👍

I would use forloop.counter in some way, like this:

{% for x in some_collection %}
{% if forloop.counter < half_of_collection_count %}
<div style="float:left;">
{%else%}
<div style="margin-left:200px;">
{%endif%}
    content
</div>

Of course, you’ll have to change the style of the diff according to your needs.

Hope this helps!

Leave a comment