Skip to main content

Table

Usage

Overview

The table is a component used to display and manipulate large, complex datasets in a scannable, easy-to-read format. Tables organize information into rows and columns, enabling users to compare data, identify patterns, and take action.

When to use

  • To present complex data that requires clear organization and structure.
  • When the order in which data is presented is significant, and users need to control sorting.
  • When users need to compare data of the same type across different items.

When not to use

  • When the presentation order of data is not as significant as the data itself. Instead, use card views or list views.
  • When the use case doesn't require direct comparison of data. Instead, use card views or list views.
  • When working with small quantities of data that would result in excessive white space. Instead, consider using a card view or list view.

Formatting

Anatomy

Anatomy of the table component with numbered callouts for the title, controls, actions, headers, rows, and pagination.

The table component consists of the following elements:

  1. Title and subtitle: A heading that describes the content of the table.
  2. Table controls: A set of controls for manipulating how data is displayed, such as search and filters.
  3. Table actions: A set of buttons that perform an operation on the table's dataset, such as adding a new record or exporting data.
  4. Column headers: Labels for each column that identify the type of data. Headers can also include sorting and other actions.
  5. Data rows: A complete set of cells representing a single item or record. Rows can include selection controls (checkboxes) and expand icons.
  6. Row actions: A set of actions in the last column that a user can take on an individual row.
  7. Pagination: Controls that allow users to navigate through pages of data and adjust the number of rows displayed per page.

Alignment and placement

By default, columns shrink to fit their content, except for the last column, which expands to fill the remaining available space. This preserves the scannability of the information.

If a table includes row actions, they must be placed in this last column.

Content

General writing guidelines

  • Use sentence case for all aspects of designing Guidewire product interfaces. Don't use title case.
  • Use present tense verbs and active voice in most situations.
  • Use common contractions to lend your copy a more natural and informal tone.
  • Use plain language. Avoid unnecessary jargon and complex language.
  • Keep words and sentences short.

Keep cell content concise

Try to have no more than 50 characters for content within a table cell to ensure readability. For longer content, the component handles overflow with the following specific rules:

  • Text between 81 and 159 characters wraps onto multiple lines.
  • Text 160 characters or longer is truncated with an ellipsis (...) and the full text will be revealed in a tooltip upon hover.
  • Numerical data must always be fully visible and does not wrap or truncate.
  • Other data formats wrap if necessary.

Write clear column headers

Headers must be short, descriptive, and written in sentence case.

  • Keep headers to one or two words. This improves scannability and ensures readability of table data.
  • Start headers with a noun when possible. Headers are labels for the data in the column, so using a noun (for example, Name, Status, Creation date) is the clearest way to describe that data.

Format numbers consistently

When writing in our source language (American English), format numbers with a comma as the thousands separator in any number with four or more digits. Do not use commas in years (unless five or more digits), page numbers, addresses, or decimals.

For other locales, follow the established localization guidelines for number formatting.

Be clear in empty states

Write direct, helpful messages that explain why the table is empty and, if possible, what the user can do next.

Behaviors

States

A table can have several states to communicate the status of the data.

  • Loading: When data is being fetched, the table body displays a loading indicator with the text "Loading data...".
  • Empty: When a table contains no data, it displays an empty state. The message must be helpful, and an action button is strongly recommended to guide the user. For example, when designing for a "No search results" state, display a Clear filters button if filters are active. The button type (primary, secondary, and tertiary) can be configured to suit the specific use case.
  • Error: If data fails to load due to a system error (like a lost internet connection), the empty state must communicate the problem and provide a recovery action, such as a Refresh button.
  • Row states: Rows can be in a default, selected (highlighted), or expanded state.

Interactions

  • Sorting: Users can click a column header to sort the table data by that column. A directional icon in the header indicates the current sort order.
  • Selecting: Users can select one or more rows using checkboxes in the first column. A checkbox in the header allows users to select or deselect all visible rows. When rows are selected, a contextual selection bar may appear at the top of the table.
  • Expanding rows: If a row is expandable, users can click the chevron icon to reveal additional, related information directly below the row.
  • Row actions: Users perform actions on a single row using the controls in the last column. Display up to two primary icon actions; place all additional actions in an ellipsis (...) menu.
  • Pagination: Users can navigate between pages of data using the pagination controls at the bottom of the table.

Responsiveness and adaptiveness

The table component is fully responsive. For mobile-first use cases, however, a card view often provides a better user experience than a traditional multi-column table.

Accessibility

The contrast ratio of textual elements against their background is above 4.5:1 as per WCAG 2.1 AA requirements. Non-textual content that needs to convey meaning (such as icons and keyboard focus visibility) has a contrast ratio of at least 3:1 with its adjacent colors. All content is visible and functional up to and including 400% without requiring scrolling in two dimensions.

This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. However, changes made by the content author can affect accessibility conformance.

When using this component within your application, ensure that:

  • A descriptive title is provided. A title, ideally using the <caption> element, helps users with screen readers understand the table's purpose before they begin navigating the data.
  • Column headers are correctly defined. Headers must be properly structured (using <th> with a scope="col" attribute) so that screen readers can announce the correct header for each data cell as a user navigates.
  • All interactive elements are accessible. Any controls inside the table, such as buttons or links, must have a clear, accessible name. For icon-only buttons, this requires providing a descriptive aria-label (for example, aria-label="Delete item").
  • The current sorting status is announced. When a column is sorted, its header must communicate the direction (ascending or descending) to screen readers, typically using the aria-sort attribute.
  • Indicate when content is loading. Set the aria-busy="true" attribute on the table when its content is actively being loaded or updated.

Keyboard navigation

The table provides comprehensive keyboard navigation following the grid pattern.

  • Arrow keys - Navigate between adjacent cells.

    • (Left Arrow) - Move to the previous cell in the current row.
    • (Right Arrow) - Move to the next cell in the current row.
    • (Up Arrow) - Move to the cell above in the same column.
    • (Down Arrow) - Move to the cell below in the same column.
  • Tab navigation - Sequential navigation through the table.

    • Tab - Move to the next focusable element.
    • Shift + Tab - Move to the previous focusable element.
  • Page navigation - Quick navigation for large tables.

    • Page Up - Move to the first row in the current column.
    • Page Down - Move to the last row in the current column.
  • Boundary navigation - Jump to table boundaries.

    • Home - Move to the first cell in the current row.
    • Ctrl + Home - Move to the first cell in the table (top-left).
    • End - Move to the last cell in the current row.
    • Ctrl + End - Move to the last cell in the table (bottom-right).

Interactive content support

The keyboard navigation system intelligently handles cells containing interactive elements:

  • Buttons and links - Interactive elements, such as sorting buttons or row actions, within cells remain accessible through both standard tab navigation and arrow keys navigation. When using arrow key navigation, if a cell contains an interactive element, such as an input field, button, or link, with a tabindex greater than -1, focus goes to that element instead of the cell. If there are multiple interactive elements in the cell, focus goes to the first one.
  • Custom focusable content - Any element with a tabindex attribute is properly integrated into the navigation flow.
  • Form inputs - When a cell contains input fields, textarea elements, or other editable form elements, the navigation respects their editing mode, which means that when focus is on such an element, arrow keys function as expected for navigation within the element. To move away from the element, use Tab or Shift + Tab.

Focus management

The table uses advanced focus management techniques:

  • Roving tabindex pattern - Only one cell in the table is focusable at a time, reducing tab stops and improving navigation efficiency.
  • Boundary awareness - Navigation keys respect table boundaries and won't move focus outside the table grid.
  • Visual focus indicators - Clear visual feedback shows which cell currently has focus.

In order for the focus management to work correctly, ensure that rowIndex and columnIndex properties are properly set for BodyCell component, and the columnIndex property is properly set for HeaderCell component. See component contracts for more details.