Adjust fixed table widths

This commit is contained in:
Fred Boniface 2023-07-12 15:06:47 +01:00
parent fe80f0c40a
commit 9045834916
2 changed files with 30 additions and 27 deletions

View File

@ -151,13 +151,7 @@
} }
</script> </script>
<div>
<table> <table>
<tr>
<th class="other" colspan="4" />
<th class="timepair" colspan="2">Arrival</th>
<th class="timepair" colspan="2">Departure</th>
</tr>
<tr> <tr>
<th class="id">ID</th> <th class="id">ID</th>
<th class="from">From</th> <th class="from">From</th>
@ -168,6 +162,11 @@
<th class="time">Sch</th> <th class="time">Sch</th>
<th class="time">Exp</th> <th class="time">Exp</th>
</tr> </tr>
<tr>
<th class="other" colspan="4" />
<th class="timepair" colspan="2">Arrival</th>
<th class="timepair" colspan="2">Departure</th>
</tr>
{#each services as service} {#each services as service}
{#await generateServiceData(service)} {#await generateServiceData(service)}
<tr><td colspan="8">Loading Service Data...</td></tr> <tr><td colspan="8">Loading Service Data...</td></tr>
@ -212,48 +211,43 @@
{/await} {/await}
{/each} {/each}
</table> </table>
</div>
<style> <style>
div {
width: auto;
margin: auto;
}
table { table {
table-layout: auto; table-layout: fixed;
text-align: center; width: 100%;
min-width: 100%;
font-size: 14px;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
color: white; color: white;
} }
th {
font-size: 12px;
margin: 0px;
}
.dataRow { .dataRow {
font-family: firamono, monospace;
vertical-align: bottom;
cursor: pointer; cursor: pointer;
font-size: 13px;
} }
/* Table Columns */ /* Table Columns */
.other {
width: 30%;
}
.id { .id {
width: 5%; width: 8%;
} }
.from { .from {
width: 10%; width: 14%;
} }
.to { .to {
width: 10%; width: 14%;
} }
.plat { .plat {
width: 5%; width: 6%;
}
.timepair {
width: 70%;
} }
.time { .time {
width: 5%; width: 9%;
} }
td.id { td.id {
@ -266,10 +260,19 @@
color: yellow; color: yellow;
text-align: left; text-align: left;
} }
td.to, th.to {
text-align: right;
}
td.from, th.from {
text-align: left;
}
.tableTxt { .tableTxt {
text-align: left; text-align: left;
padding-left: 2px; padding-left: 2px;
color: var(--second-text-color); color: var(--second-text-color);
vertical-align: top;
font-size: 12px;
} }
/* Conditional Classes */ /* Conditional Classes */

View File

@ -84,7 +84,7 @@
</tr> </tr>
{#each data as item} {#each data as item}
<tr> <tr>
<td class="toc toc-data">{item.operator || '-'}</td> <td class="toc toc-data">{item.toc || '-'}</td>
<td class="code">{item.code}</td> <td class="code">{item.code}</td>
<td class="stops stops-data">{item.stops.join(' ')}</td> <td class="stops stops-data">{item.stops.join(' ')}</td>
</tr> </tr>