mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Add col-X classes to HTML table on custom query page
This commit is contained in:
parent
1e4c295012
commit
e2750c7cc0
2 changed files with 4 additions and 3 deletions
|
|
@ -79,6 +79,7 @@ class RenderMixin(HTTPMethodView):
|
|||
**context, **{
|
||||
'app_css_hash': self.ds.app_css_hash(),
|
||||
'select_templates': select_templates,
|
||||
'zip': zip,
|
||||
}
|
||||
})
|
||||
)
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@
|
|||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{% for column in columns %}<th scope="col">{{ column }}</th>{% endfor %}
|
||||
{% for column in columns %}<th class="col-{{ column|to_css_class }}" scope="col">{{ column }}</th>{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
{% for td in row %}
|
||||
<td>{% if td == None %}{{ " "|safe }}{% else %}{{ td }}{% endif %}</td>
|
||||
{% for column, td in zip(columns, row) %}
|
||||
<td class="col-{{ column|to_css_class }}">{% if td == None %}{{ " "|safe }}{% else %}{{ td }}{% endif %}</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue