How to make div not larger than its content?

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.

You would have to create fixed width and height of your desired table.