Skip to content

fix(table): stop centering unaligned headers - #1670

Merged
DamaraNadhra merged 4 commits into
nextfrom
damara/table-header-alignment
Nov 4, 2026
Merged

DamaraNadhra merged 4 commits into
nextfrom
damara/table-header-alignment

Conversation

@DamaraNadhra

@DamaraNadhra DamaraNadhra commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
🎫 Resolve RM-19351

🎯 What does this PR do?

Problem

A table header with no alignment renders centered or left depending on what wraps the table, so the same markdown looks different across surfaces

Root Cause

Browsers center th by default and only follow an alignment set on a parent element. Hub doc pages wrap the article in a .Flex with text-align: left, so headers come out left there and centered anywhere without one. components/Table/style.scss never set it

Fix

  • Unaligned th now uses text-align: inherit, so it lines up with the body cells under any wrapper
  • Column alignment (:---:, ---:) renders as an inline style on the cell, so it still wins

Pairs with the readme PR that drops the editor's th centering. Either can merge first

🧪 QA tips

  • Render a table with a plain | --- | separator outside a hub page: headers line up with the body cells instead of centering
  • Render one with :---: and ---:: those columns stay centered and right-aligned
  • make updateSnapshot: only the unaligned headers in the tables snapshots move from center to left

📸 Screenshot or Loom

Before After
Editor before-editor after-editor
Viewer before-markdown-viewer after-markdown-viewer

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed changes appear safe to merge.

Reviews (2) · Last reviewed commit: "test: update table of contents snapshot" · Reviewed by Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 3, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review November 3, 2026 04:11

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@DamaraNadhra DamaraNadhra added the anand-review Attach to trigger the anand-review AI reviewer (COMMENT review; label removed when the run ends) label Nov 3, 2026
@github-actions github-actions Bot removed the anand-review Attach to trigger the anand-review AI reviewer (COMMENT review; label removed when the run ends) label Nov 3, 2026
@DamaraNadhra
DamaraNadhra merged commit 139d238 into next Nov 4, 2026
9 checks passed
@DamaraNadhra
DamaraNadhra deleted the damara/table-header-alignment branch November 4, 2026 23:43
rafegoldberg pushed a commit that referenced this pull request Nov 9, 2026
## Version 16.2.1
### 🛠 Fixes & Updates

* address flagged CodeQL alerts ([#1682](#1682)) ([3b14a86](3b14a86))
* move lint and format to oxlint and oxfmt ([#1680](#1680)) ([85c915b](85c915b))
* **deps:** patch Dependabot security vulnerabilities ([#1679](#1679)) ([bfc9c1b](bfc9c1b))
* pulling dependabot updates back a bit ([a9906c3](a9906c3))
* **mdxish:** space callouts under tight list items ([#1671](#1671)) ([f21e0d8](f21e0d8))
* **table:** stop centering unaligned headers ([#1670](#1670)) ([139d238](139d238))
* **deps-dev:** upgrade vitest to v5 ([#1681](#1681)) ([0946e08](0946e08))

<!--SKIP CI-->
@rafegoldberg

Copy link
Copy Markdown
Collaborator

This PR was released!

🚀 Changes included in v16.2.1

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants