Skip to content

Commit d3fb642

Browse files
committed
fix: correct table-layout
1 parent dfd810a commit d3fb642

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/components/PaginatedTable/PaginatedTable.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,11 @@ export const PaginatedTable = <T, F>({
183183

184184
// Render merged empty tbody for consecutive inactive chunks
185185
chunks.push(
186-
<tbody
187-
key={`merged-${startIndex}-${i - 1}`}
188-
style={{
189-
height: `${totalHeight}px`,
190-
display: 'block',
191-
}}
192-
/>,
186+
<tbody key={`merged-${startIndex}-${i - 1}`}>
187+
<tr style={{height: `${totalHeight}px`}}>
188+
<td colSpan={columns.length} style={{padding: 0, border: 'none'}} />
189+
</tr>
190+
</tbody>,
193191
);
194192
}
195193
}

src/components/PaginatedTable/TableChunk.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,16 @@ export const TableChunk = typedMemo(function TableChunk<T, F>({
160160
id={id.toString()}
161161
style={{
162162
height: `${dataLength * rowHeight}px`,
163-
// Default display: table-row-group doesn't work in Safari and breaks the table
164-
// display: block works in Safari, but disconnects thead and tbody cell grids
165-
// Hack to make it work in all cases
166-
display: shouldRender ? 'table-row-group' : 'block',
163+
display: 'table-row-group',
167164
}}
168165
>
169-
{renderContent()}
166+
{shouldRender ? (
167+
renderContent()
168+
) : (
169+
<tr style={{height: `${dataLength * rowHeight}px`}}>
170+
<td colSpan={columns.length} style={{padding: 0, border: 'none'}} />
171+
</tr>
172+
)}
170173
</tbody>
171174
);
172175
});

0 commit comments

Comments
 (0)