Skip to content
CdsTable

Pinning and scrolling

Working with tables that do not fit on the screen: pinning the header and columns while scrolling, and horizontal scroll buttons.

Storybook GitLab Figma
Test coverage: 0% — low coverage
API in specs
0 / 72 props, events, slots and exposed members with a test
Test cases
13 unit · 0 browser
Code coverage
15.2% lines · 7.4% branches measured in v4.0.0-alpha.13
A11y (axe)
50 recommendations in 39 stories measured in v4.0.0-alpha.11

Fixed header ​

The scroll.y property limits the height of the table body — the column header stays in place while you scroll vertically.

Fixed columns ​

The column's fixed: 'left' | 'right' property pins it during horizontal scrolling. Set scroll.x wider than the container so that scrolling appears.

Fixed columns and header ​

Together, scroll.x and scroll.y pin both the columns and the header — the center of the table scrolls in both directions.

Scroll buttons ​

A table with horizontal scrolling can get scroll buttons: take the DOM node of the table body (.cds-table__body) through the component ref and change its scrollLeft on click.