Skip to content

fix: auto right-align numeric columns and normalize decimal formatting in tables#8887

Merged
mscolnick merged 2 commits intomainfrom
kg/table-format-align
Mar 26, 2026
Merged

fix: auto right-align numeric columns and normalize decimal formatting in tables#8887
mscolnick merged 2 commits intomainfrom
kg/table-format-align

Conversation

@kirangadhave
Copy link
Copy Markdown
Contributor

📝 Summary

Numeric columns are properly aligned

Closes #8871

🔍 Description of Changes

Improves readability of numeric columns in mo.ui.table by auto-aligning and normalizing number formatting.

  • numeric columns are automatically right-aligned by default.
  • number of digits after decimals are normalized so everything is aligned and scannable
  • numeric cells use font-variant-numeric: tabular-nums for uniform char width (no col jiggle)

Also fixed boolean column rendering to be more pythonic: True/False instead of true/false

Before:
Screenshot 2026-03-26 at 2 27 54 PM

After:
Screenshot 2026-03-26 at 2 28 11 PM

Added tests for auto-alignment, fraction digits, boolean rendering

📋 Checklist

  • I have read the contributor guidelines.
  • Tests have been added for the changes made.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 26, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 26, 2026 9:42pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kirangadhave
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@kirangadhave kirangadhave added the enhancement New feature or request label Mar 26, 2026
Copy link
Copy Markdown
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, much better on the eyes!

@mscolnick mscolnick merged commit 6bb4852 into main Mar 26, 2026
28 checks passed
@mscolnick mscolnick deleted the kg/table-format-align branch March 26, 2026 22:01
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.21.2-dev64

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align formatted numbers in table

2 participants