I have table with 700px width and row with 1400px width, so table will have horizontal scroll. How to make body element to have width same as row has?
<div style={{ width: 700, overflow: 'auto' }} className='table'>
<div className='body'>
<div style={{ width: 1400 }} className='row' />
</div>
</div>
Currently body has table width(which is 700px) and I can’t find any way to increase it
2
Answers
You can use
max-content
on the body element to take the width of its children.You can use this:
Be sure to check its’ compatibility here.