{% load i18n forms %}

<fieldset class="inline tabular-inline {{ class_names|join:' ' }}{% if class %} {{ class }}{% endif %}">
	{% block inline-title %}{% if title %}<legend>{{ title|capfirst }}</legend>{% endif %}{% endblock %}
	{% block above-table %}{% endblock %}
	<table class="form">
		{% for row in data_list %}
			{% if forloop.first %}
				{% block inline-thead %}
					<thead>
						<tr>
							{% for field_name, field_value in header_list %}
								<th class="field-{{ field_name }}">{{ field_value }}</th>
							{% endfor %}
						</tr>
					</thead>
					<tbody>
				{% endblock %}
			{% endif %}
			<tr class="inline-line {% cycle 'odd' 'even' %}{% if row.class_names %} {{ row.class_names|join:' ' }}{% endif %}{% if form.class_names %} {{ form.class_names|join:' ' }}{% endif %}">
				{% for field_name, field_value in row %}
				<td class="field field-{{ field_name }}">
					{{ field_value }}
				</td>
				{% endfor %}
			</tr>
			{% if forloop.last %}</tbody>{% endif %}
		{% endfor %}
	</table>
	{% block below-table %}{% endblock %}
</fieldset>
