Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ We've made fixes to NHS.UK frontend in the following pull requests:
- [#908: Updating secondary, reverse and warning buttons to use their hover variable rather than darkening the base colour](https://github.com/nhsuk/nhsuk-frontend/pull/908)
- [#1169: Update visually hidden behaviour to match GOV.UK Frontend](https://github.com/nhsuk/nhsuk-frontend/pull/1169)
- [#1173: Focus skip link target to improve screen reader announcements](https://github.com/nhsuk/nhsuk-frontend/pull/1173)
- [#1174: Fix Table component responsive semantics when `firstCellIsHeader` is set](https://github.com/nhsuk/nhsuk-frontend/pull/1174)

## 9.3.0 - 13 February 2025

Expand Down
12 changes: 8 additions & 4 deletions packages/components/tables/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@
}
}

.nhsuk-table__row th {
text-align: right;
}

.nhsuk-table__row th,
.nhsuk-table__row td {
display: block; // For browsers that don't support flexbox
display: flex;
Expand All @@ -118,12 +115,18 @@
}

@media all and (-ms-high-contrast: none) {
.nhsuk-table__row th,
.nhsuk-table__row td {
display: block; // [10]
}
}

@include mq($until: desktop) {
.nhsuk-table__row th {
font-weight: $nhsuk-font-normal;
}

.nhsuk-table__row th,
.nhsuk-table__row td {
padding-right: 0;
text-align: right; // [7]
Expand All @@ -147,6 +150,7 @@
text-align: left;
}

.nhsuk-table__row th,
.nhsuk-table__row td {
display: table-cell;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/components/tables/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@
{{- cell.html | safe if cell.html else cell.text -}}
{% endset -%}

{%- if loop.first and params.firstCellIsHeader and not params.responsive %}
{%- if loop.first and params.firstCellIsHeader %}
<th scope="row" class="nhsuk-table__header
{%- if cell.classes %} {{ cell.classes }}{% endif %}"
{%- if params.responsive %} role="rowheader"{% endif %}
{{- commonAttributes | safe }}>
{{- commonContents | safe -}}
</th>
Expand Down