title: Make div width adapt automatically to contents within it
body: <p>I have a <code>div</code> within which a <code>table</code> would lie. Now I want this <code>div</code> to have its width set automatically to the width of <code>table</code> within it.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;div&gt;
    &lt;table&gt;
      &lt;tr&gt;
        &lt;td&gt;Hello&lt;/td&gt;
        &lt;td&gt;World&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Sample&lt;/td&gt;
        &lt;td&gt;Table&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I tried giving <code>float: left;</code> property to it. It works, but then it creates another problem. Whatever content is put after this div gets placed to the right of it in the empty space.</p>
  
  <p>What needs to be done?</p>