Table
A table is a set of structured data that is easy for a user to scan, examine, and compare. Table data is displayed in a grid format and can be used to structure both interactive and static data.
Name | House | Birthday |
---|---|---|
Luna Lovegood | Ravenclaw | June 25, 1993 |
Draco Malfoy | Slytherin | December 3, 1992 |
Hermione Granger | Gryffindor | September 19, 1979 |
Neville Longbottom | Gryffindor | July 30, 1980 |
Props
Usage guidelines
- Displaying a set of structured data in a scannable way, that populates 2 or more rows.
- Allowing users to compare information in rows and columns.
- There will never be enough data to populate at least 2 rows.
- Displaying content that doesn’t follow a consistent pattern and can't be broken down into columns.
- Providing robust data that doesn't fit in a tabular format. If there is a need to display a more complex data relationship, consider an info-graphic or a non-tabular format.
Best practices
Style
Status | Campaign | |
---|---|---|
Engagement | ||
Awareness | ||
Catalogs | ||
Awareness | ||
Conversions |
Use accessible Gestalt grays for table text, and reserve colors to sparingly accent important status and information. Avoid over-styling text.
Status | Campaign | |
---|---|---|
Engagement | ||
Awareness | ||
Catalogs | ||
Awareness | ||
CONVERSIONS |
Overuse color and styling for text in tables; it can make it hard to scan for important status updates and crucial information.
Alignment
Campaign | Spend | |
---|---|---|
$5.50 | ||
$3,000.00 | ||
$1.75 | ||
$51,650,500.54 | ||
$67.60 |
Align content so that it’s easy to scan, read and compare:
- Start-align text and combo-content (combinations of text, numbers and/or graphics)
- End-align numbers only
- Align headers with their corresponding content
- Use tabular lining for numbers
Campaign | Spend | |
---|---|---|
$5 | ||
$3,000.00 | ||
$1.750 | ||
$51,650,500.54 | ||
$67.60 |
Align content so that it makes it harder to scan, read, and compare.
- Center-align content
- Use proportional figures for numbers as they don’t quite align
- End-align text and combo-content (combinations of text, numbers and/or graphics)
- Misalign headers with their corresponding content
Status | Rate | Type |
---|---|---|
Active Ends 11/20/2021 | 100 | CTR |
Paused Ends 11/20/2021 | 5,000 | Engagement |
Warning Ends 11/20/2021 | 2 | Conversions |
Complete Ends 11/20/2021 | 50 | CTR |
Place unit type on a separate column so that amounts can still align and be compared.
Status | Rate |
---|---|
Active Ends 11/20/2021 | 100 CTR |
Paused Ends 11/20/2021 | 5,000 Engagement |
Warning Ends 11/20/2021 | 2 Conversions |
Complete Ends 11/20/2021 | 50 CTR |
Mix text and graphics with numbers that need to be compared with each other.
Content
Name | Total |
---|---|
Video views for all Q3 campaigns and ad groups David Brown, Carlota Ojeda, Olamide Olufemi, Rajesh Uttambai | -- |
Video views for all Q2 campaigns and ad groups David Brown, Carlota Ojeda | 5,000 |
Video views for all Q2 ad groups David Brown, Carlota Ojeda, Olamide Olufemi, Rajesh Uttambai | 6,455,434 |
Make content digestible and scannable:
- Keep headers clear and concise
- Include an a visual indicator for cells that don’t have content.
- Give enough space for content to account for localization.
- Wrap important content to multiple lines
- Truncate secondary information, especially if a user is going to get the full content upon click of a link in the table.
Name | Total amounts for 2021 through 2022 |
---|---|
Video views for all Q3 campaigns and ad groups David Brown, Carlota Ojeda, Olamide Olufemi, Rajesh Uttambai | |
Video views for all Q2 campaigns and ad groups David Brown, Carlota Ojeda | 5,000 |
Video views for all Q2 ad groups David Brown, Carlota Ojeda, Olamide Olufemi, Rajesh Uttambai | 6,455,434 |
Add so much content that it’s hard for a user to read, examine and scan:
- Don’t truncate content that a user needs to examine in relation to other content in the table.
- Leave cells blank so that it isn’t clear if all data has loaded.
Open/Close row | Name | Team | Role | Office Hours |
---|---|---|---|---|
Ayesha Teng | Gestalt | Engineer | Monday, Friday | |
Ryan Costa | Analytics | Designer | Wednesdays | |
Kate Steele | Monetization | Design Technologist | Tuesdays, Thursdays |
Expand rows if the additional content is simple, doesn’t contain a lot of interaction and doesn’t take up more than 50% of the screen.
Open/Close row | Campaing | Status | Budget | Scope |
---|---|---|---|---|
December '21 | Active | $100,000 | Global | |
January '22 | Draft | $50,000 | Japan, Germany, Canada, Spain, Mexico, Thailand, Italy | |
February '22 | Draft | $50,000 | Japan, Germany, Canada |
Use an expand to display dense, highly-interactive content. Use a new page or a Sheet for that.
Localization
Be sure to localize text
and accessibilityLabel
.
Note that localization can lengthen text by 20 to 30 percent; follow our guidelines on concise content and headings to account for localization.
Wrap important table content instead of truncating. Use truncation only for secondary content, and include a tooltip to show the full text on hover.
Accessibility
Labels
Use accessibilityLabel
to properly announce the content of the table. For example, use "Campaign Status Information".
Don’t include the word “table” as part of the label to prevent redundancy: the VoiceOver already appends “table” to the label and the Category “Table” in the rotor already describes the nature of the component.
In terms of structure and content, HTML tables already provide accessible ways to navigate content via cells <td>
and headers <th>
.
The Tab key should only place the focus on interactive elements like sortable headers, expands and links. If a cell does not contain interactive content, tabbing should skip the cell. Enter, Space and Return activate buttons and other controls after focusing. Arrow keys can be used to scroll table content vertically and horizontally.
Other considerations
Internally, Gestalt Table implements visually-hidden
captions through the accessibilityLabel
prop. Therefore, if we want to add visual captions (at the top or bottom of the Table), we must prevent redundancy. Any top or bottom text that describes the Table should be removed from navigation using aria-hidden
.
See the examples below for more details.
Status | Campaign | |
---|---|---|
In progress Ends 11/20/2021 | ||
Paused Ends 11/20/2021 | ||
Warning Ends 11/20/2021 | ||
Complete Ends 11/20/2021 |
Status | Campaign | |
---|---|---|
In progress Ends 11/20/2021 | ||
Paused Ends 11/20/2021 | ||
Warning Ends 11/20/2021 | ||
Complete Ends 11/20/2021 |
Subcomponents
Table.Body Props
Table.Cell Props
Table.Header Props
Table.HeaderCell Props
Table.Row Props
Table.RowExpandable Props
Table.SortableHeaderCell Props
Variants
Sticky header
Image | Name | House |
---|---|---|
![]() | Luna Lovegood | Ravenclaw |
![]() | Draco Malfoy | Slytherin |
![]() | Neville Longbottom | Gryffindor |
Sticky Column
Try scrolling horizontally to see the first column remain in place.
Image | Name | Super Name | Favorite Food | Best Friend | Birthday |
---|---|---|---|---|---|
![]() | Tony Stark | Iron Man | Shawarma | Spiderman | May 29, 1970 |
![]() | Peter Parker | Spiderman | Sandwiches | Iron Man | December 28, 1995 |
![]() | T'Challa | Black Panther | Beef suya | Shuri | November 28, 1977 |
Multiple sticky columns
Try scrolling horizontally to see the first 3 columns remain in place.
Image | Name | Super Name | Best Friend | Favorite Food | Super Powers | Home | Aliases |
---|---|---|---|---|---|---|---|
![]() | Tony Stark | Iron Man | Spiderman | Shawarma | Flight, Super strength | New York | N/A |
![]() | Peter Parker | Spiderman | Iron Man | Sandwiches | Spidey senses, super strength, web shooters | Brooklyn | Friendly Neighborhood Spiderman |
![]() | Wanda Maximoff | Scarlet Witch | Vision | Chicken paprikash | Chaos magic, spells, reality warping | Sokovia | N/A |
![]() | T'Challa | Black Panther | Shuri | Beef suya | Enhanced strength, speed, reflexes + Vibranium suit | Wakanda | King of the Dead |
Sticky header and sticky columns
Try scrolling horizontally and vertically to see the columns and header remain in place.
Image | Name | Super Name | Best Friend | Favorite Food | Super Powers | Home | Aliases |
---|---|---|---|---|---|---|---|
![]() | Tony Stark | Iron Man | Spiderman | Shawarma | Flight, Super strength | New York | N/A |
![]() | Peter Parker | Spiderman | Iron Man | Sandwiches | Spidey senses, super strength, web shooters | Brooklyn | Friendly Neighborhood Spiderman |
![]() | Wanda Maximoff | Scarlet Witch | Vision | Chicken paprikash | Chaos magic, spells, reality warping | Sokovia | N/A |
![]() | T'Challa | Black Panther | Shuri | Beef suya | Enhanced strength, speed, reflexes + Vibranium suit | Wakanda | King of the Dead |
Table Row Expandable
Expandable row that is able to hold content that will displayed depending on the clickable expand/collapse button icon.
Open/Close row | Name | House | Birthday |
---|---|---|---|
Luna Lovegood | Ravenclaw | June 25, 1993 | |
Draco Malfoy | Slytherin | December 3, 1992 | |
Neville Longbottom | Gryffindor | July 30, 1980 |
Table Row Expandable with Sticky Columns
When specifying stickyColumns
with expandable rows, include the column of arrows in your count. This example sets stickyColumns
to 3.
Open/Close row | Name | Super Name | Best Friend | Favorite Food | Home | Alias | Super Powers |
---|---|---|---|---|---|---|---|
Tony Stark | Iron Man | Spiderman | Shawarma | New York City | N/A | Flight, Super strength | |
Wanda Maximoff | Scarlet Witch | Vision | Chicken paprikash | Sokovia | Wanda Frank | Chaos magic, spells, reality warping | |
T'Challa | Black Panther | Shuri | Beef suya | Wakana | King of the Dead | Enhanced strength, speed, reflexes + Vibranium suit |
Sortable header cells
Sortable header cells are clickable in an accessible way and have an icon to display whether the table is currently being sorted by that column.
Name | Id |
---|
Sortable header cells with sticky columns
Name | Nickname | Favorite Food | Best Friend | Birthdate | Description | Favorite Color |
---|