Skip to content

feat(table): add width parameter to control table width behavior#9965

Open
allin2 wants to merge 2 commits into
marimo-team:mainfrom
allin2:fix/table-column-auto-width
Open

feat(table): add width parameter to control table width behavior#9965
allin2 wants to merge 2 commits into
marimo-team:mainfrom
allin2:fix/table-column-auto-width

Conversation

@allin2

@allin2 allin2 commented Jun 23, 2026

Copy link
Copy Markdown

Summary

The table component previously used auto-width for tables with ≤ 4 columns, which caused space waste for tables with long content.

Motivation

Fixes #9921

Users reported that tables with few columns but long content had wasted space and truncated text.

Changes

  • feat: Added width parameter to mo.ui.table()
    • 'auto': uses minimum width needed for columns
    • 'full': fills the available width (default)
  • Updated frontend to use the new parameter
  • Default is 'full' which preserves the original behavior for most cases

Usage

# Use auto-width for tables with few columns
mo.ui.table(data, width='auto')

# Use full-width (default)
mo.ui.table(data, width='full')

Validation

  • Default behavior (width='full') is preserved
  • Users can now control width behavior explicitly
  • Fixes the space waste issue for tables with long content

Checklist

  • Code follows the project's style guidelines
  • Tests pass
  • No unrelated changes included
  • Commit message follows Conventional Commits format

Review in cubic

The table component previously used auto-width for tables with ≤ 4
columns, which caused space waste for tables with long content.

Added a  parameter to mo.ui.table():
- 'auto': uses minimum width needed for columns
- 'full': fills the available width (default)

This gives users control over the table width behavior.

Fixes marimo-team#9921
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jun 23, 2026 12:09pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty table column auto width

1 participant