Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>@Boushley's answer was the closest, however there is one problem not addressed that has been pointed out. The <em>right</em> div takes the entire width of the browser; the content takes the expected width. To see this problem better:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; * { margin: 0; padding: 0; } body { height: 100%; } #left { opacity: 0; height: inherit; float: left; width: 180px; background: green; } #right { height: inherit; background: orange; } table { width: 100%; background: red; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="left"&gt; &lt;p&gt;Left&lt;/p&gt; &lt;/div&gt; &lt;div id="right"&gt; &lt;table&gt;&lt;tr&gt;&lt;td&gt;Hello, World!&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><a href="http://jsfiddle.net/79hpS/" rel="nofollow noreferrer">http://jsfiddle.net/79hpS/</a></p> <p>The content is in the correct place (in Firefox), however, the width incorrect. When child elements start inheriting width (e.g. the table with <code>width: 100%</code>) they are given a width equal to that of the browser causing them to overflow off the right of the page and create a horizontal scrollbar (in Firefox) or not float and be pushed down (in chrome).</p> <p>You can <strong>fix this</strong> easily by adding <code>overflow: hidden</code> to the right column. This gives you the correct width for both the content and the div. Furthermore, the table will receive the correct width and fill the remaining width available.</p> <p>I tried some of the other solutions above, they didn't work fully with certain edge cases and were just too convoluted to warrant fixing them. This works and it's simple.</p> <p>If there are any problems or concerns, feel free to raise them.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload