{% if df.height > 0 %}
<table class="race-history-table">
    <thead>
        <tr>
            <th>Date</th>
            <th>Venue</th>
            <th>Place</th>
            <th>Finish Time</th>
            <th>Track</th>
            <th>Course</th>
            <th>Distance</th>
            <th>Going</th>
            <th>Rating</th>
            <th>Draw</th>
            <th>Pos</th>
            <th>Style</th>
        </tr>
    </thead>
    <tbody>
        {% for row in df.iter_rows(named=True) %}
        <tr>
            <td>{{ row["Date"] }}</td>
            <td>{{ row["Venue"] }}</td>
            <td>{{ row["Pla"] }}</td>
            <td>{{ row["FinishTime"] }}</td>
            <td>{{ row["Track"] }}</td>
            <td>{{ row["Course"] }}</td>
            <td>{{ row["Dist"] }}</td>
            <td>{{ row["G"] }}</td>
            <td>{{ row["Rtg"] }}</td>
            <td>{{ row["Dr"] }}</td>
            <td>{{ row["RunningPosition"] }}</td>
            <td>{{ row["RunningStyle"] }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% else %}
No similar races in historical records.
{% endif %}