Skip to content

fix: align column headers with text_justify_columns setting #8178

Open
maxkoretskyi wants to merge 2 commits intomarimo-team:mainfrom
maxkoretskyi:main
Open

fix: align column headers with text_justify_columns setting #8178
maxkoretskyi wants to merge 2 commits intomarimo-team:mainfrom
maxkoretskyi:main

Conversation

@maxkoretskyi
Copy link
Contributor

Summary

Column headers now follow the same alignment as cell data when using text_justify_columns.

Closes #7967

Description of Changes

When text_justify_columns is set (e.g., {"Age": "right"}), only cell data was aligned — column headers stayed left-aligned, creating a visual mismatch.

The fix passes the justify value from generateColumns through to DataTableColumnHeader, which applies:

  • flex-row-reverse for right-aligned columns (swaps the sort/filter icon to the left)
  • text-right / text-center on the header text span

Before:
Headers left-aligned, data right-aligned.

After:
Headers match the cell data alignment.

Files changed:

  • column-header.tsx — accepts justify prop, applies alignment classes
  • columns.tsx — passes justify to the header component
  • columns.test.tsx — adds test for header justification

Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@vercel
Copy link

vercel bot commented Feb 7, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 7, 2026 4:25pm

Request Review

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mo.ui.table: right-justify column headers

2 participants