I have a table which has a lot of columns and hence causes a vertical scroll. How do I make a div sibling of the table expand to the full width of that table.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <body> <div style='background: green'> foobarbaz </div> <table> <tr> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> <td style='background: red'>foobarbazfoobarbazfoobarbazfoobarbaz</td> </tr> </table> </body> </html>
As you'll see here, the div width is only equal to the width of the body. I need the div width to match the width of the overflowing table.
Thanks