{% use "DeskPRO:Form:form_div_layout.html.twig" %}

{% block field_row %}
{% spaceless %}
    <tr>
        <td>
            {{ form_label(form, label|default(null)) }}
        </td>
        <td>
            {{ form_errors(form) }}
            {{ form_widget(form) }}
        </td>
    </tr>
{% endspaceless %}
{% endblock field_row %}

{% block form_errors %}
{% spaceless %}
    {% if errors|length > 0 %}
    <tr>
        <td colspan="2">
            {{ block('field_errors') }}
        </td>
    </tr>
    {% 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 %}
{% spaceless %}
    <table {{ block('widget_container_attributes') }}>
        {{ block('field_rows') }}
        {{ form_rest(form) }}
    </table>
{% endspaceless %}
{% endblock form_widget %}
