{% load i18n adminmedia %}

<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
   <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
   {{ inline_admin_formset.formset.non_form_errors }}
   <table>
     <thead>
       <tr>
         {% for field in inline_admin_formset.fields %}
           {% if not field.widget.is_hidden %}
             <th{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}</th>
           {% endif %}
         {% endfor %}
       </tr>
     </thead>
     <tbody>
       {% for inline_admin_form in inline_admin_formset %}
         <tr class="{% cycle "row1" "row2" %}">
         {% for fieldset in inline_admin_form %}
          {% for line in fieldset %}
            {% for field in line %}
              <td class="{{ field.field.name }}" style="padding: 5px;">
                  {{ field.contents }}
              </td>
            {% endfor %}
          {% endfor %}
        {% endfor %}
         </tr>
       {% endfor %}
     </tbody>
   </table>
</fieldset>
