Data tables display data points in rows and columns.
Overview
Data tables organize complex data for the user. Users can then use the tables to manipulate, filter, and compare data to meet their needs.
Data tables will vary in size, depending on the amount of data they need to show. But using the same design ensures consistency across all USAC products.
Design and Implementation
Rows
Alternate between gray and white for the background color of rows. This allows for easy reading across long rows and between rows.
Columns
Keep a 1px white space between each column to delineate between columns.
Pad $indi-space-inset-default above and below the text in both rows and columns.
Sorting
Sorting allows users to reorder the contents in a table by clicking on a sortable column. Only one column can sort the table at a time.
If a column is sortable, the header should look clickable (i.e., be blue like a link). If a column isn’t sortable, the header should be gray.
Download
Action
To indicate which column is currently sorting the table, use the green stroke that spans the column width below the header text. In addition, an arrow indicating the correct sorting direction should appear. If clicked, the arrow will flip to indicate the alternate sorting direction.
Use Guidelines
Use when
Displaying large amounts of data in a tabular way.
Organizing and comparing multiple data points.
Don’t Use When
The number of columns exceeds the space on the page.
You can display the data in any other way using charts, graphs, or other data visualizations.
Editorial
Avoid lengthy column headers.
Introduce a data table with a clear introduction or instructions.
Links and icons can live in cells.
Don’t put buttons in a cell.
Present data in a human, readable format. Do not display underscores, symbols, or characters that are meant for the computer to read.
Accessibility
Always use <th> tags with a proper <scope> attribute in table headers when displaying data. The data tables component is designed for columns so use <th scope="col">.