Skip to content

Commit 0baca70

Browse files
author
Miles Hinchliffe
committed
Correct the classes of the <th> elements
1 parent 5a77fdb commit 0baca70

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/lib/components/data-vis/table/Table.svelte

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@
5151
5252
$inspect("columns array is ", columns);
5353
54-
const metrics = Object.keys(localCopyOfData[0]).slice(
55-
1,
56-
localCopyOfData[0].length,
57-
);
54+
const metrics = columns
55+
.filter((column) => column.dataType === "number")
56+
.map((column) => column.key);
5857
5958
$inspect("metrics is", metrics);
6059
@@ -145,13 +144,10 @@
145144
<caption class="govuk-table__caption">{caption}</caption>
146145
<thead class="govuk-table__head"
147146
><tr class="govuk-table__row">
148-
<!-- <th scope="col" class="govuk-table__header" aria-sort="ascending"
149-
>Area</th
150-
> -->
151147
{#each columns as column}
152148
<th
153149
scope="col"
154-
class="govuk-table__header govuk-table__header--numeric"
150+
class={`govuk-table__header ${column.dataType === "number" ? "govuk-table__header--numeric" : ""}`}
155151
title={metaData[column.key].explainer}
156152
aria-sort="none"
157153
>

0 commit comments

Comments
 (0)