I have a table in a div as following:
<div className="second-row-container">
<Table
rowsCount={this.state.myTableData.length}
rowHeight={50}
headerHeight={50}
width={9*150}
height={(this.state.myTableData.length+1)*50}>
<Column
header={<Cell>Delivery</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].delivery}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Category</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].age}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Language</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].language}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Target market</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].market}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Valid from</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].valid_from}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Valid till</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].valid_till}
</Cell>
)}
width={150}
/>
<Column
header={<Cell>Visibility</Cell>}
cell={props => (
<Cell {...props}>
{this.state.myTableData[props.rowIndex].visibility}
</Cell>
)}
width={150}
/>
<Column
header={<Cell></Cell>}
cell={props => (
<Cell {...props}>
</Cell>
)}
width={150}
/>
<Column
header={<Cell></Cell>}
cell={props => (
<Cell {...props}>
</Cell>
)}
width={150}
/>
</Table>
</div>
And in css I have:
.second-row-container{
height: 50vh;
background-color: lightgray;
padding: 0.5%;
width: 100%;
}
I thought by making parent width 100% the table will always be shrinking when I shrink the screen, but it doesn't.
How can I make the table fit in the parent div and on small screens I would like columns 3,4,5 and 6 to hide. How can I achieve this?