Replace the <dl> with a <table>

main
Jasper Bok 2023-08-18 11:26:33 +02:00
parent 03fe6bc16b
commit 3bc4e72970
2 changed files with 23 additions and 20 deletions

View File

@ -22,14 +22,19 @@
<h2>{{ .Name }}</h2> <h2>{{ .Name }}</h2>
<p>{{ .Town }}</p> <p>{{ .Town }}</p>
<dl> <table>
{{ range $i, $val := .Departures }} <tbody>
{{ range $i, $val := .Departures }}
{{ if lt $i 3 }} {{ if lt $i 3 }}
<dt>{{ $val.RouteShortName }} | {{ $val.StopHeadsign }}</dt> <tr>
<dd><time>{{ formatTime $val.DepartureTime }}</time></dd> <td>{{ $val.RouteShortName }}</td>
<td>{{ $val.StopHeadsign }}</td>
<td><time>{{ formatTime $val.DepartureTime }}</time></td>
</tr>
{{ end }} {{ end }}
{{ end }} {{ end }}
</dl> </tbody>
</table>
</article> </article>
{{ end }} {{ end }}
</main> </main>

View File

@ -22,20 +22,6 @@ p {
margin-top: 0; margin-top: 0;
} }
dt {
display: inline-block;
font-weight: bold;
}
dd {
display: inline;
}
dd::after {
content: "\A";
white-space: pre;
}
header { header {
background: #000; background: #000;
color: #fff; color: #fff;
@ -45,4 +31,16 @@ header {
main { main {
padding: 1rem 2rem; padding: 1rem 2rem;
}
td {
padding: .2rem .8rem;
}
td:first-child {
padding-left: 0;
}
td:last-child {
padding-right: 0;
} }