title: Expand div to fit fixed width content in IE 6 and 7
body: <p>I need a div with a border to wrap around arbitrarily sized fixed-width content (this means I do not know what that fixed width will be, it changes from page to page). </p>
  
  <p>The below html does what I'd expect in IE 6, that is, if you size the browser window down to less than the width of the content (in this case a fixed-width <code>&lt;p&gt;</code>, but it could be any fixed width content), the div with the border stops shrinking at the right-hand edge of the content. However, in IE 7 (and FF), the border continues to shrink down to stay within the browser window's width, going behind and showing through the content.</p>
  
  <p>Is there a way to make the div shrink and grow with the browser window, but never have a width less than the content?</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
    Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  
    &lt;head&gt;
      &lt;title&gt;Border Test&lt;/title&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div style="border: 1px #0000FF solid;padding:3px;"&gt;
        &lt;p style="width:700px;"&gt;
          Lorem ipsum dolor sit amet, consectetur 
          adipiscing elit. Praesent varius mi a leo
          ultrices consequat. Nam id venenatis ligula. 
          Suspendisse et faucibus eros. Donec quis 
          augue eu nunc cursus blandit vel vel odio.
          Suspendisse rutrum aliquet massa, eu ultricies
          elit laoreet a. Curabitur feugiat cursus.
        &lt;/p&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Update: I did some poking around in IE 8, and <code>display:table</code> in the <code>&lt;div&gt;</code> style declaration fixes it there.</p>
  
  <pre><code>&lt;div style="border: 1px #0000FF solid;padding:3px;display:table;"&gt;
  </code></pre>
  
  <p>Is there any way to simulate <code>display:table</code> in IE 7?</p>