Better way to make side-by-side DIVs in CSS

Posted by JoelFan on Stack Overflow See other posts from Stack Overflow or by JoelFan
Published on 2010-06-11T04:02:15Z Indexed on 2010/06/11 4:12 UTC
Read the original article Hit count: 551

Filed under:
|

I have 2 DIV's that I want to be side-by-side under all circumstances. So far I am accomplishing it like this:

<div style="float: left">
    <table> ... </table>
</div>

<div style="float: right; overflow: scroll; width: 1000px">
    <pre> ... </pre>
</div>

However, I don't like that I have to specify an absolute width in the 2nd div.

I just want the 1st div to be the minimum width to display the table and 2nd div to take up the rest of the space without overflowing.

Is there a better way?

© Stack Overflow or respective owner

Related posts about html

Related posts about css