Skip to content
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

Update table markdown guidance #149

Merged
merged 1 commit into from
Mar 29, 2021
Merged

Update table markdown guidance #149

merged 1 commit into from
Mar 29, 2021

Conversation

ChrisBAshton
Copy link
Contributor

This removes the requirement to add a <div> above and below tables. This was originally required because omitting them would break the table completely, but this no longer seems to be an issue. The spacing between the table and the surrounding content is now slightly reduced as a result, but this should be fixed with CSS in the tech docs gem, rather than with non-semantic content.

This commit also documents new accessibility guidance whereby tables with 3 or more columns need a row header, introduced in alphagov/tech-docs-gem#214.

While I'm here, I've updated the markdown example to use padded cells for horizontal alignment, which is good practice if there is room to do so. I've also omitted the |:---| left-alignment instruction, since cells are left-aligned by default. Most markdown table examples you'll come across in the wild use the default |---| separator.

Context

Changes proposed in this pull request

Guidance to review


- Centre: `|:---:|`
- Right: `|---:|`

Add more columns and rows as needed.
If a table has three or more columns, you likely need to set a row header in addition to the column headers. Setting a row header improves the experience for screen reader users, as it reduces the amount of information they need to remember while navigating the table.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Style point: "three" => "3".
  • Recommend rephrasing "you likely need to" to "you might need to"
  • Recommend adding a link to the W3 accessibility tutorials on tables at https://www.w3.org/WAI/tutorials/tables/ for more information to help people decide if they need to add a row header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review 👍 I've pushed up an amended commit.

Copy link
Contributor

@jonathanglassman jonathanglassman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content looks good overall @ChrisBAshton. I've commented on a few specific things.

This removes the requirement to add a `<div>` above and below tables. This was originally required because omitting them would break the table completely, but this no longer seems to be an issue. The spacing between the table and the surrounding content is now slightly reduced as a result, but this should be fixed with CSS in the tech docs gem, rather than with non-semantic content.

This commit also documents new accessibility guidance whereby tables with 3 or more columns need a row header, introduced in alphagov/tech-docs-gem#214.

While I'm here, I've updated the markdown example to use padded cells for horizontal alignment, which is good practice if there is room to do so. I've also omitted the `|:---|` left-alignment instruction, since cells are left-aligned by default. Most markdown table examples you'll come across in the wild use the default `|---|` separator.
@jonathanglassman jonathanglassman merged commit ef78042 into alphagov:master Mar 29, 2021
@ChrisBAshton ChrisBAshton deleted the patch-1 branch March 29, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants