This is horizontal laying
This answer did all the work of css stacking
from flask_wtf import Form class SimpleForm2(Form): menu_items = MultiCheckboxField('Menu Item', choices=[], coerce=int)
form_test.html
{% include "base.html" %} {% import "bootstrap/wtf.html" as wtf %} {% from "macros.html" import render_field %} {% block page_content %} {% macro render_form44(form, action_url='', action_text='Submit', class_='', btn_class='btn btn-default') -%} {{ form.hidden_tag() if form.hidden_tag }} {% if caller %} {{ caller() }} {% else %} {% for f in form %} {% if f.type == 'BooleanField' %} {{ render_checkbox_field(f) }} {% elif f.type == 'RadioField' %} {{ render_radio_field(f) }} {% else %} {{ render_field(f) }} {% endif %} {% endfor %} {% endif %} {%- endmacro %} <style type="text/css"> fieldset.group { margin: 0; padding: 0; margin-bottom: 1.25em; padding: .125em; } fieldset.group legend { margin: 0; padding: 0; font-weight: bold; margin-left: 20px; font-size: 100%; color: black; } ul.checkbox { margin: 0; padding: 0; margin-left: 20px; list-style: none; } ul.checkbox li input { margin-right: .25em; } ul.checkbox li { border: 1px transparent solid; display:inline-block; width:12em; } ul.checkbox li label { margin-left: ; } ul.checkbox li:hover, ul.checkbox li.focus { background-color: lightyellow; border: 1px gray solid; width: 12em; } .checkbox { -webkit-column-count: 6; -moz-column-count: 6; column-count: 6; } </style> <form method="POST" role="form"> <fieldset class="group"> <legend>Pick Menu Items</legend> <ul class="checkbox"> {{ render_form44(form) }} </ul> </fieldset> <fieldset class="group"> <legend>Pick Contents</legend> <ul class="checkbox"> {{ render_form44(form1) }} </ul> </fieldset> <button type="submit">OK</button> </form> {% endblock %}

source share