From e850bcc190cde6acb55f75cff906e74b1cc70beb Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Mon, 11 Mar 2024 09:47:05 +0000 Subject: [PATCH] Add table examples --- .../utilities/tables/tables.stories.js | 58 ++++++++++--------- src/nationalarchives/utilities/_tables.scss | 27 +++++++-- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/src/nationalarchives/stories/utilities/tables/tables.stories.js b/src/nationalarchives/stories/utilities/tables/tables.stories.js index d48a689b..3622e286 100644 --- a/src/nationalarchives/stories/utilities/tables/tables.stories.js +++ b/src/nationalarchives/stories/utilities/tables/tables.stories.js @@ -4,42 +4,44 @@ export default { const TableTemplate = () => ` - + - - - + + + + - - - - - - - - - + + + + + - - - - + + + + + - - - - + + + + + + + + + + + + +
Primary options + Records added and removed between 2020 and 2022 +
NameTypeDescriptionYearChinese zodiac signRecords addedSize (megabytes)
itemsarray -

Required.

-

See items.

-
noCollapsestring
2020Rat123,456789
classesstring -

Classes to add to the breadcrumbs.

-
2021Ox456,789123
attributesobject -

HTML attributes (for example data attributes) to add to the breadcrumbs.

-
2022Tiger42,4241,337
Totals622,6692,249
`; export const Table = TableTemplate.bind({}); diff --git a/src/nationalarchives/utilities/_tables.scss b/src/nationalarchives/utilities/_tables.scss index 869c9fd6..10be4924 100644 --- a/src/nationalarchives/utilities/_tables.scss +++ b/src/nationalarchives/utilities/_tables.scss @@ -4,7 +4,6 @@ @use "../tools/media"; @use "../tools/spacing"; @use "../tools/typography"; -@use "../variables/assets"; @use "../variables/grid"; .tna-table { @@ -20,23 +19,32 @@ } &__caption { - text-align: left; + padding: 1rem 0; - @include typography.main-font-weight-bold; + caption-side: bottom; + + @include typography.relative-font-size(16); } &__head { + vertical-align: bottom; } - &__header { + &__body { + vertical-align: top; } - &__body { + &__foot { + @include typography.main-font-weight-bold; + vertical-align: top; } &__row { } + &__header { + } + &__cell { } @@ -53,12 +61,21 @@ &:last-child { padding-right: 0; } + + &--numeric { + text-align: right; + } } &__head &__header { @include colour.colour-border("keyline-dark", 4px, solid, bottom); } + &__foot &__header, + &__foot &__cell { + @include colour.colour-border("keyline-dark", 4px, solid, top); + } + p { + p { margin-top: 0.25rem;