{% if name %}
    <p class="h4">{{ name }}</p>
{% endif %}
{% if rows | length > 0 %}
    <table class="table table-condensed stats">
        {% if rows[0]['value'].__class__.__name__ == 'list' %}
            <thead>
                <tr>
                    <th>&nbsp;</th>
                    {% for v in rows[0]['value'] %}
                        <th style="color: {{ style.primary_colors[loop.index0] }};">{{ style._labels[loop.index0] }}</th>
                    {% endfor %}
                </tr>
            </thead>
        {% endif %}
        <tbody>
            {% for row in rows %}
                <tr{% if 'alert' in row and row['alert'] %} class="alert"{% endif %}>
                    <th>{{ row['name'] }}</th>
                    {% if row['value'].__class__.__name__ == 'list' %}
                        {% for value in row['value'] %}
                            <td>{{ value }}{% if loop.last and 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
                        {% endfor %}
                    {% else %}
                        <td>{{ row['value'] }}{% if 'hint' in row %} {{ row['hint'] }}{% endif %}</td>
                    {% endif %}
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endif %}
{% if caption %}
    <div class="caption text-center text-muted">
        {{ caption }}
    </div>
{% endif %}