I am trying to make sticky header in table in react and in order to do this, copied the table head and make the container position absolute relative to the table div. But the issue is the width of the table cell is not the same. I want to get the width of each column in the table and set the sticky header column width to make them the same. How can I do it after render?
This is the code structure:
<div className="tableDataContainer">
<div className="stickyHeader">
<Table>
<TableHead></TableHead>
</Table>
</div>
<Table>
<TableHead></TableHead>
<TableBody></TableBody>
</Table>
</div>