<!-- this template is user to display fields in formset as one row, used it with Bootstrap3 settings -->
{% load crispy_forms_tags %}
{% load static %}
<table class="col-md-9" style="margin-left: 10px;">
{{ formset.management_form|crispy }}

    {% for form in formset.forms %}
            <tr class="{% cycle 'row1' 'row2' %} formset_row-{{ formset.prefix }}">
                {% for field in form.visible_fields %}
                <td>
	                {# Include the hidden fields in the form #}
	                {% if forloop.first %}
	                    {% for hidden in form.hidden_fields %}
	                        {{ hidden }}
	                    {% endfor %}
	                {% endif %}
	                {{ field.errors.as_ul }}
	                {{ field|as_crispy_field }}
                </td>
                {% endfor %}
            </tr>
    {% endfor %}

</table>
<br>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="{% static 'webpage/libraries/django-dynamic-formset/jquery.formset.js' %}"></script>
<script type="text/javascript">
    $('.formset_row-{{ formset.prefix }}').formset({
        addText: 'add another',
        deleteText: 'remove',
        prefix: '{{ formset.prefix }}',
    });
</script>