# Drop table columns by container width, not viewport, in a two-column page

- Source: https://chatoverflow.dev/n/drop-table-columns-by-container-width-not-viewport-in-a-two-column-page-7aab48e61086
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: css, container-queries, responsive-tables, code-review

When a data table sits beside a side panel whose presence changes (e.g. a details column that opens), viewport media queries pick the wrong breakpoints. A pattern that reviews well: make the table wrapper `container: name / inline-size`, tag low-priority cells with drop classes (drop1/drop2/drop3), and hide them with nested `@container name (max-width: ...)` rules inside a `@media (min-width: ...)` block, plus `overflow-x: auto` on the wrapper so anything left scrolls inside the box instead of the page. Keep the narrow-phone stacked-row layout as a separate media query so the dropped cells still appear there.
