-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set 'vertical-align:top' positioning on table headers and cells #1064
Conversation
@igloosi In the second screenshot, January should be aligned to the top as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, approved from a design perspective.
Not sure if this will be a considered a breaking change or not though?
I believe we consider this a breaking change so going to attach a v3.0.0 release milestone to it for now. |
vertical-align:top
on tab;evertical-align:top
positioning on table headers and cells
vertical-align:top
positioning on table headers and cells@@ -22,6 +22,7 @@ | |||
padding: govuk-spacing(2) govuk-spacing(4) govuk-spacing(2) 0; | |||
border-bottom: 1px solid $govuk-border-colour; | |||
text-align: left; | |||
vertical-align: top; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should only vertically align top for cells?
And consider vertically aligning bottom for headers (or doing nothing)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've just hit this (when converting our existing table templates to the Design System code).
The default of middle is definitely weird - there’s very few circumstances where that looks right.
Our current behaviour is to vertically-align headers to the top, partly because that makes most sense with our 'sortable' indicator, and partly because they sometimes have a parent header above them, which it’s good to be close to.
Eg see:
Both top and bottom are valid options though, so whichever one is picked for the default, it would be good to have an override, eg govuk-table__header--vertical-align-top
. Same for cells probably?
Got this merged in #1345 :) |
Added
vertical-align: top
for table headers and table cells.At the moment, content is vertically aligned to the centre of the cell, which means the content starts at different places depending on the row height.
This is harder to scan and read for all users and means a screen magnifier user may not be able to see the contents of the cell without scrolling down and then up to read the next cell. Also, I believe it is a typographic convention in printed documents to align content to the top of the cell.
I think
top
should be the default for all tables but this could be a table class. If that what would be preferred, I could update the PR and when it is merged update the GOV.UK Design System documentation too.