<table class="table table-hover tablesorter tablesorter-filter">
    {% for row in result %}
    {% if loop.index0 == 0 %}
    <thead>
    <tr>
        {% for key, value in context.0 %}
            <th>{{ key|replace({'_': ' '})|capitalize }}</th>
        {% endfor %}
    </tr>
    </thead>
    <tbody>
    {% endif %}
    <tr>
        {% for value in row %}
            <td>{{ value }}</td>
        {% endfor %}
    </tr>
    {% else %}
        <tr>
            <td>No entries found</td>
        </tr>
    {% endfor %}
    </tbody>
</table>
