column-pinning

Pin table columns into start and end regions with sticky CSS offsets.

28.4k|3.6k|Updated Oct 20, 2016
One-click install
npx skills add https://github.com/TanStack/table --skill column-pinning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: column-pinning
Source: https://github.com/TanStack/table/tree/main/packages/table-core/skills/column-pinning
Command: npx skills add https://github.com/TanStack/table --skill column-pinning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @tanstack/table-core.

What problem does it solve?

Keeping key columns visible while scrolling wide TanStack Table datagrids requires coordinating pinning state, numeric offsets, and sticky CSS, which is easy to get wrong and produces gaps, overlaps, or broken RTL layouts.

Core Features & Use Cases

  • Logical Region Pinning: Pin columns into start and end regions using columnPinningFeature, with direction-aware offsets via getStart and getAfter.
  • Renderer-Owned Sticky CSS: Apply position: sticky, insetInlineStart/insetInlineEnd, z-index, and background styles so pinned cells stay visible over scrolling content.
  • Width Consistency: Synchronize rendered cell widths with column.getSize() so sticky offsets match the DOM and avoid gaps or overlaps.
  • Use Case: Pin a row's name column to the start and an actions column to the end of a wide React data grid so both remain visible during horizontal scrolling, including in RTL locales.

Quick Start

Pin the name column to the start and the actions column to the end of my TanStack table with sticky positioning that works in RTL layouts.

Frequently Asked Questions about column-pinning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I pin columns in TanStack Table?

Register columnPinningFeature with tableFeatures, set initialState.columnPinning with start and end column ID arrays, then call column.pin('start') or column.pin('end'). Apply sticky positioning styles yourself since the feature only computes regions and offsets.

Why is my pinned column not sticking when scrolling?

The columnPinningFeature only computes pinning state and offsets; it does not apply CSS. You must set position: sticky, insetInlineStart or insetInlineEnd from getStart/getAfter, plus a background and z-index on the cell.

Does TanStack Table column pinning support RTL layouts?

Yes, version 9 uses logical start and end regions instead of physical left and right. Use CSS logical properties like insetInlineStart and insetInlineEnd so offsets adapt automatically to the document direction.

Why do pinned columns show gaps or overlap other cells?

Gaps and overlaps occur when rendered cell widths diverge from the model sizes used for sticky offsets. Set each cell's width to column.getSize() in pixels so the DOM matches the computed offset values.

What changed for column pinning when migrating from v8 to v9?

Version 9 replaced physical left and right pinning with logical start and end regions across state and collection APIs. Calls like column.pin('left') must be updated to column.pin('start').