{% load icons %}

{% if title %}<h3>{{ title }}</h3>{% endif %}

{% if csv_url %}
    <div class="form-actions">
        {% spaceless %}
            <a href="{{ csv_url }}" class="btn pull-right">
                {% icon 'fugue-fugue-icon fugue-blue-document-excel-csv' %}&nbsp;Export result to CSV
            </a>
        {% endspaceless %}
    </div>
{% endif %}

<table class="table table-striped table-bordered table-condensed">
    <tr>
        <th></th>
        {% for th in header %}
            <th>{{ th }}</th>
        {% endfor %}
    </tr>
    {% for row in rows %}
        <tr>
            <td>{{ forloop.counter }}.</td>
            {% for td in row %}
                <td>{{ td }}</td>
            {% endfor %}
        </tr>
    {% endfor %}
</table>
