Skip to content

Commit a5f1030

Browse files
committed
fix: render table header row
1 parent a21f374 commit a5f1030

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/react-notion-x/src/block.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,10 @@ export function Block(props: BlockProps) {
789789
const formatMap = tableBlock.format?.table_block_column_format
790790
const backgroundColor = block.format?.block_color
791791

792+
const hasRowHeader = tableBlock.format?.table_block_column_header === true
793+
794+
const isHeaderRow = hasRowHeader && tableBlock.content?.[0] === block.id
795+
792796
if (!tableBlock || !order) {
793797
return null
794798
}
@@ -798,6 +802,7 @@ export function Block(props: BlockProps) {
798802
className={cs(
799803
'notion-simple-table-row',
800804
backgroundColor && `notion-${backgroundColor}`,
805+
isHeaderRow && 'notion-simple-table-header-row',
801806
blockId
802807
)}
803808
>

packages/react-notion-x/src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ svg.notion-page-icon {
26722672
font-size: 14px;
26732673
}
26742674

2675-
.notion-simple-table tr:first-child td {
2675+
.notion-simple-table-header-row td {
26762676
background: var(--bg-color-0);
26772677
}
26782678

0 commit comments

Comments
 (0)