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

Responsive table #635

Merged
merged 1 commit into from
Sep 25, 2020
Merged

Responsive table #635

merged 1 commit into from
Sep 25, 2020

Conversation

Fenwick17
Copy link
Contributor

@Fenwick17 Fenwick17 commented Sep 23, 2020

Description

Component for a responsive and accessible table

How it works

When viewed on a destkop the table component will behave like any other table. However, when viewed on a mobile the table collapses into what appears to be a group list style component.
The markup remains the same as it did originally, so when using a screen reader it will still be read out as if it was a normal table just with a different visual representation.
To do this the markup includes numerous extra attributes and elements paired with CSS to modify the layout of the table.

  • CSS is used to modify the layout to use flex and block
  • Roles are added to all table elements which will then mean screenreader behaviour remains the same and despite having a different visual representation, it will still behave as a normal table would
  • aria-hidden is used to provide visual context of the heading which is no longer visible, this will be the same content used in the appropriate table heading

Desktop view

Screenshot 2020-09-25 at 16 39 58

Mobile view

Screenshot 2020-09-25 at 16 40 08

When to use

This should only be used to show tabular data when your table has 3 columns or more.

Further documentation to follow.

Checklist

@Fenwick17 Fenwick17 added accessibility Accessibility related component labels Sep 23, 2020
@Fenwick17 Fenwick17 mentioned this pull request Sep 23, 2020
3 tasks
@Fenwick17 Fenwick17 changed the title Feature/responsive table component Responsive table Sep 24, 2020
@chrimesdev chrimesdev force-pushed the feature/responsive-table-component branch 9 times, most recently from a04487c to 7c810a7 Compare September 24, 2020 13:36
@davidhunter08

This comment has been minimized.

@Fenwick17 Fenwick17 force-pushed the feature/responsive-table-component branch from 08d99ab to 84f4f97 Compare September 25, 2020 15:54
@Fenwick17 Fenwick17 force-pushed the feature/responsive-table-component branch from 84f4f97 to dff98b7 Compare September 25, 2020 15:56
@chrimesdev chrimesdev merged commit 5c59cc6 into master Sep 25, 2020
@chrimesdev chrimesdev deleted the feature/responsive-table-component branch September 25, 2020 16:04
@davidhunter08 davidhunter08 linked an issue Sep 30, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Accessibility related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create responsive table component
3 participants