If you have a table with content that can’t be broken up because it doesn’t have spaces or there are lots of columns then the width may be greater than the viewport – especially if you are using a laptop or mobile browser.
In this instance the content will break out of the enclosing div.
To resolve this,
use style display:table
Works with IE 8 onwards and tells the div to display as a table.
use style float:left
Works with IE6 onwards
When an element is floated it uses the value of defined width or auto in which case it shrinks to fit its content.
There’s a definition of shrink-to-fit by the W3C http://www.w3.org/TR/css3-box/#shrink-to-fit