Html – How to make a div not larger than its contents

csshtmlwidth

I have a layout similar to:

<div>
    <table>
    </table>
</div>

I would like for the div to only expand to as wide as my table becomes.

Best Answer

The solution is to set your div to display: inline-block.