Search code examples
flaskbootstrap-4jinja2bootstrap-flask

How to remove spacing between form fields while using Bootstrap Flask's render_form_row


How can I use something like "no-gutters" while using this render_form_row bootstrap-flask function?

https://bootstrap-flask.readthedocs.io/en/stable/macros.html#id10

I tried the following and it did not work

{{ render_form_row([form.variable1, form.variable2], row_class='no-gutters') }}

Solution

  • I ended just using the following solution:

    <div class="row no-gutters">
        <div class="col">
            {{ render_field(form.variable1) }}
        </div>
        <div class="col">
            {{ render_field(form.variable2) }}
        </div>
    </div>