{% load i18n %}
<tr id="form-{{field.name}}">
    <td style="text-align:right;">
    {% if field.errors %}<div class="ym-fbox-text ym-error"><span class="ym-message">{% endif %}
        {% trans field.label %}
    {% if field.errors %}</span></div>{% endif %}
    </td>
    <td>
        <div class="{{css_class|default:'ym-fbox-text'}} {% if field.errors %}ym-error{% endif %}">
        {{ field }}
        </div>
        <div class="ym-fbox-text ym-error">
            {% for error in field.errors %}
                <p class="ym-message">{% trans error %}</p>
            {% endfor %}
        </div>
        
        {% if field.help_text %}<p class="dimmed">{% trans field.help_text %}</p>{% endif %}
    </td>
</tr>

{% load i18n %}
<tr id="form-{{field.name}}">
    <td style="text-align:right;">
    {% if field.errors %}<div class="ym-fbox-text ym-error"><span class="ym-message">{% endif %}
        {% trans field.label %}
    {% if field.errors %}</span></div>{% endif %}
    </td>
    <td>
        <div class="{{css_class|default:'ym-fbox-text'}} {% if field.errors %}ym-error{% endif %}">
        {{ field }}
        </div>
        
        {% if field.errors %}
            <div class="ym-fbox-text ym-error">
                {% for error in field.errors %}
                    <p class="ym-message">{% trans error %}</p>
                {% endfor %}
            </div>
        {% endif %}
        
        {% if field.help_text %}<p class="dimmed">{% trans field.help_text %}</p>{% endif %}
    </td>
</tr>

Hide empty DIV if there are no error messages
Hide empty DIV if there are no error messages
