UI Patterns

Table with linked rowsStatusdevelopment

Guidance

Tables are a useful pattern for summarising a list of data, and sometimes it is necessary for each entry to link onwards to further details.

This pattern shows a way to mark up the table when the design requires the whole table row to be linked, rather than a single cell.

Example with linked rows

Open in a new tab

<div class="table__container"><table class="table table--has-caption"><caption class="table__caption">Example table</caption><thead class="table__head"><tr class="table__row"><th class="table__th" scope="col">Name</th><th class="table__th" scope="col">Job title</th><th class="table__th" scope="col">Date of birth</th><th class="table__th table__th--hidden" scope="col">Link</th></tr></thead><tbody class="table__bd"><tr class="table__row table__row--link"><td data-th="Name" class="table__td">Joe Example</td><td data-th="Job title" class="table__td">Web developer</td><td data-th="Date of birth" class="table__td">1 Jan 1970</td><td class="table__td table__td--link"><a class="table__link" href="#"><span class="visually-hidden">More details about Joe Example</span></a></td></tr><tr class="table__row table__row--link"><td data-th="Name" class="table__td">Joe Example</td><td data-th="Job title" class="table__td">Web developer</td><td data-th="Date of birth" class="table__td">1 Jan 1970</td><td class="table__td table__td--link"><a class="table__link" href="#"><span class="visually-hidden">More details about Joe Example</span></a></td></tr><tr class="table__row table__row--link"><td data-th="Name" class="table__td">Joe Example</td><td data-th="Job title" class="table__td">Web developer</td><td data-th="Date of birth" class="table__td">1 Jan 1970</td><td class="table__td table__td--link"><a class="table__link" href="#"><span class="visually-hidden">More details about Joe Example</span></a></td></tr><tr class="table__row table__row--link"><td data-th="Name" class="table__td">Joe Example</td><td data-th="Job title" class="table__td">Web developer</td><td data-th="Date of birth" class="table__td">1 Jan 1970</td><td class="table__td table__td--link"><a class="table__link" href="#"><span class="visually-hidden">More details about Joe Example</span></a></td></tr></tbody></table></div>

Acceptance criteria

The following is a list of example acceptance criteria to test against when using this pattern. These critera should test that the specific markup requirements are met, and that the search behaves visually and functionally as expected.

For validation in developer tools / web inspector

For visual validation

For functional validation

References