Skip to content

Commit f07220a

Browse files
(Table): consider scope
1 parent db0873b commit f07220a

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/scripts/Table.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export const TableRowColumn: FC<TableRowColumnProps> = (props) => {
223223
className: oClassNames,
224224
width,
225225
children,
226+
scope,
226227
...pprops
227228
} = props;
228229
const style: CSSProperties = {};
@@ -238,11 +239,15 @@ export const TableRowColumn: FC<TableRowColumnProps> = (props) => {
238239
children
239240
);
240241

241-
return (
242-
<td style={style} className={oClassNames} {...pprops}>
243-
{cellContent}
244-
</td>
245-
);
242+
const CellComponent = scope === 'row' ? 'th' : 'td';
243+
const cellProps = {
244+
style,
245+
className: oClassNames,
246+
...pprops,
247+
...(scope === 'row' ? { scope: 'row' } : {}),
248+
};
249+
250+
return <CellComponent {...cellProps}>{cellContent}</CellComponent>;
246251
};
247252

248253
/**

0 commit comments

Comments
 (0)