{% use "form_div_layout.html.twig" %}

{% block form_row %}
{% spaceless %}
    <tr>
        <td>
            {{ form_label(form, label|default(null)) }}
        </td>
        <td>
            {% if not compound %}
                {{ form_errors(form) }}
            {% endif %}
            {{ form_widget(form) }}
        </td>
    </tr>
{% endspaceless %}
{% endblock form_row %}

{% block form_errors %}
{% spaceless %}
    {% if not compound %}
        {{ parent() }}
    {% else %}
        {% if errors|length > 0 %}
        <tr>
            <td colspan="2">
                {{ parent() }}
            </td>
        </tr>
        {% endif %}
    {% endif %}
{% endspaceless %}
{% endblock form_errors %}

{% block hidden_row %}
{% spaceless %}
    <tr style="display: none">
        <td colspan="2">
            {{ form_widget(form) }}
        </td>
    </tr>
{% endspaceless %}
{% endblock hidden_row %}

{% block form_widget_compound %}
{% spaceless %}
    <table {{ block('widget_container_attributes') }}>
        {{ block('form_rows') }}
        {{ form_rest(form) }}
    </table>
{% endspaceless %}
{% endblock form_widget_compound %}
