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>
<p>{{ .Town }}</p>
<dl>
{{ range $i, $val := .Departures }}
<table>
<tbody>
{{ range $i, $val := .Departures }}
{{ if lt $i 3 }}
<dt>{{ $val.RouteShortName }} | {{ $val.StopHeadsign }}</dt>
<dd><time>{{ formatTime $val.DepartureTime }}</time></dd>
<tr>
<td>{{ $val.RouteShortName }}</td>
<td>{{ $val.StopHeadsign }}</td>
<td><time>{{ formatTime $val.DepartureTime }}</time></td>
</tr>
{{ end }}
{{ end }}
</dl>
{{ end }}
</tbody>
</table>
</article>
{{ end }}
</main>

View File

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