I want to set the header of , (not for div header) from React-bootstrap while using making it vertically and horizontally scrollable.
I have tried to make it work by using display: block
but it's messing up table in responsive mode.
render() {
return (
<div className="padding-top-16" id="maximise" >
{this.renderActionItems()}
<div className={'col-xs-12'} style={{ marginTop: '16px', marginBottom: '16px' }}>
<Table hover responsive>
<thead>
{this.renderHeaders()}
</thead>
<tbody>
{this.renderRows()}
</tbody>
</Table>
</div>
</div>
);
}
}
.table-responsive {
max-height: 550px;
border: 1px solid var(--colorInputBorder);
color: var(--colorDarkPrimary);
border-radius: 5px;
}
.table-responsive td,
.table-responsive th {
white-space: nowrap;
padding: 8px 20px !important;
}
This is what i have done to make the table vertically and horizontally scrollable and it's working fine but the header is not fixed.
NOTE: As i have used react-bootstrap the class named responsive
adds extra <div>
outside of <Table>
with class name table-responsive
I DO NOT WANT TO MAKE IT WORK BY SETTING WIDTH MANUALLY