20 lines
No EOL
599 B
HTML
20 lines
No EOL
599 B
HTML
<table>
|
|
{% if rows %}
|
|
<thead>
|
|
<tr>
|
|
{% if headers %}
|
|
{% for header in headers %}<th>{{ header }}</th>{% endfor %}
|
|
{% else %}
|
|
{% for field in fields if field != "id" %}<th>{{ field }}</th>{% endfor %}
|
|
{% endif %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr>{% for _, cell in row.items() if _ != "id" %}<td>{{ cell if cell else "-" }}</td>{% endfor %}</tr>
|
|
{% endfor %}
|
|
{% else %}
|
|
<tr><th>No data.</th></tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table> |