{# Renders a formset in an html table, one form per row, one field per column #}

<form method="post">

    {% csrf_token %}

    <table class="table table-hover">
        <thead>
        <tr>
            {% with form=formset.forms|first %}
                {% for field in form %}
                    <td>{{ field.label_tag }}</td>
                {% endfor %}
            {% endwith %}
        </tr>
        </thead>
        <tbody>
        {% for form in formset %}
            <tr>
                {% for field in form %}
                    <td>{% include 'fmft/form_field.html' %}</td>
                {% endfor %}
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {{ formset.management_form }}

    <div class="form-actions">
        <button class="btn btn-primary" name="submit" type="submit">
            Save
        </button>
    </div>
</form>
