1👍
✅
Nice and easy, just use col-md-6 as you already have for field 1 and field 2, but for field 3 use col-md-6 and col-md-offset-6.
So it needs to be as follows:
<div class="col-md-6"></div><div class="col-md-6"></div>
<div class="col-md-6 col-md-offset-6"></div>
<div class="col-md-6"></div><div class="col-md-6"></div>
<div class="col-md-6 col-md-offset-6"></div>
Use CSS to change the offset direction:
.col-md-offset-6 {
margin-right: 50% !important;
}
👤Alex
1👍
Couldn’t you move your if condition to be above your application of the col-md-6? I’m not familiar with django’s syntax, but something like:
{% for field in form %}
{% if field.name == 'field3' %}
{% bootstrap_field field form_group_class='col-md-12 form-group label-floating' %}
{% else %}
{% bootstrap_field field form_group_class='col-md-6 form-group label-floating' %}
{% endif %}
{% endfor %}
👤Capo
- [Answered ]-How do i get to collect static files ? i cant run this project it raises the error
- [Answered ]-Set creator automatically with DjangoRestFramework
- [Answered ]-Django – get_object_or_404 returns 500 instead of 404
Source:stackexchange.com