[Fixed]-MultipleChoiceField on multiple columns

1👍

{% for field in form %}
  {% ifequal forloop.counter 6 %}</ul><ul>{% endifequal %}
  <li>{{ field }}</li>
{% endfor %}

you can try something like this

0👍

<form method="POST" class="post-form">{% csrf_token %}
     <div class="form-check form-check-inline">
        {% for field in form %}             
            {% if forloop.counter|divisibleby:3 %}</div><div class="form-check form-check-inline">{% endif %}
                {{ field.errors }}
                {{ field.label_tag }} {{ field }}            
        {% endfor %}
     </div>          
      <button type="submit" class="save btn btn-default">Save</button>
</form>

But probably you should use django-bootstrap3 which helps you to integrate django and bootstrap.

    Leave a comment