<th> now gets class="col-X" - plus added col-X documentation

Refs #209
This commit is contained in:
Simon Willison 2018-04-17 19:11:11 -07:00
commit a5792a8c61
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
4 changed files with 25 additions and 7 deletions

View file

@ -66,7 +66,7 @@ The row template (``/dbname/tablename/rowid``) gets::
<body class="row db-dbname table-tablename">
The ``db-x`` and ``table-x`` classes use the database or table names themselves IF
The ``db-x`` and ``table-x`` classes use the database or table names themselves if
they are valid CSS identifiers. If they aren't, we strip any invalid
characters out and append a 6 character md5 digest of the original name, in
order to ensure that multiple tables which resolve to the same stripped
@ -82,6 +82,23 @@ Some examples::
"-" => "336d5e"
"no $ characters" => "no--characters-59e024"
``<td>`` and ``<th>`` elements also get custom CSS classes reflecting the
database column they are representing, for example::
<table>
<thead>
<tr>
<th class="col-id" scope="col">id</th>
<th class="col-name" scope="col">name</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-Link"><a href="...">1</a></td>
<td class="col-name">SMITH</td>
</tr>
</tbody>
</table>
Custom templates
----------------