feat: add full-width column resizing example#6233
Open
govindarajug wants to merge 1 commit intoTanStack:mainfrom
Open
feat: add full-width column resizing example#6233govindarajug wants to merge 1 commit intoTanStack:mainfrom
govindarajug wants to merge 1 commit intoTanStack:mainfrom
Conversation
Adds a new React example demonstrating how to make a table fill its container width with the last column stretching to occupy remaining space. Columns remain individually resizable while maintaining the full-width behavior. Uses ResizeObserver for responsive container tracking and CSS variables for performant resize rendering. This addresses a common use case discussed in TanStack#4825, TanStack#4880, TanStack#5120, and TanStack#5870 where users need tables that fill their container width with proper resize behavior.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new React example (
column-resizing-full-width) that demonstrates how to make a TanStack Table fill its container width, with the last column automatically stretching to fill remaining space while keeping all columns individually resizable.This is a commonly requested pattern — several open issues describe the challenge of making tables fill their container width with proper resize behavior:
clientWidth, bad experience with limited width tables #5870 — column resizing doesn't respectclientWidthHow it works
getColumnWidth()computes each column's width — if total columns width < container width, the last column stretches to fill the gap--col-{id}-size) are used for performant resize rendering (same pattern ascolumn-resizing-performantexample)widthis set toMath.max(totalColumnsWidth, containerWidth)so it always fills the containerKey features
Test plan
columnResizeMode: 'onChange'