Skip to content

feat: table header rendering optimization #630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LooseLi
Copy link

@LooseLi LooseLi commented May 6, 2025

Description

Fixes #628

Simple tables always show the first row with header styling (background color), regardless of whether header settings are enabled. This is inconsistent with Notion's native behavior.

This PR fixes table header rendering to only apply styling when explicitly enabled:

  • Row headers (first row): Only styled when table_block_column_header is true
  • Column headers (first column): Only styled when table_block_row_header is true

Note: There's an interesting naming confusion in Notion's API - table_block_column_header actually controls row headers, while table_block_row_header controls column headers. This PR maintains the original field names for API compatibility but implements the correct behavior.

After
image

Notion Test Page ID

1eb1578febe58070a07edf70bd34025d

Copy link

vercel bot commented May 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview May 6, 2025 10:12am
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview May 6, 2025 10:12am

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.

Table Style
1 participant