1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-07 06:37:01 +02:00

Fix issue in sticky-table-column pattern

This commit is contained in:
Phuoc Nguyen
2021-03-28 19:50:35 +07:00
parent 2e3ca01022
commit 58b1c76d45

View File

@@ -59,14 +59,17 @@ const Details: React.FC<{}> = () => {
return ( return (
<th <th
key={index} key={index}
style={ style={(
Object.assign({}, { index === 0
padding: '16px', ? {
}, index === 0 ? {
backgroundColor: '#ddd', backgroundColor: '#ddd',
left: 0, left: 0,
padding: '16px',
position: 'sticky', position: 'sticky',
} : {}, }
: {
padding: '16px',
}
)} )}
> >
<div style={{ width: '200px' }}> <div style={{ width: '200px' }}>
@@ -92,14 +95,15 @@ const Details: React.FC<{}> = () => {
return ( return (
<td <td
key={col} key={col}
style={ style={(
Object.assign({}, { col === 0 ? {
padding: '16px',
}, col === 0 ? {
backgroundColor: '#ddd', backgroundColor: '#ddd',
left: 0, left: 0,
padding: '16px',
position: 'sticky', position: 'sticky',
} : {}, } : {
padding: '16px',
}
)} )}
> >
{ {