-3
Good afternoon, how do I know the size of an element to change the width
of another child element?
I have a Container element that wraps the Table
when the table
have a width
greater than 1400px
I want to be able to know and manipulate the father Container
to change some values of it, for example:
I don’t want more than the thead th
be it:
thead th {
position: sticky;
top: 0;
}
and yes be:
thead th {
position: relative;
top: 10px;
}
container element:
const Container
= styled.div`
overflow: scroll;
position: relative;
width: 1368px;
thead th {
position: sticky;
top: 0;
}
`
container and table component:
<Container>
<Table>
{renders}
</Tabled>
</Container>
@media (min-width: 1400px) { Container > table thead th {position:Static;} }
– hugocsl