Note that there are some explanatory texts on larger screens.

plurals
  1. POTable width in IE
    text
    copied!<p><img src="https://i.stack.imgur.com/pKn1b.jpg" alt="enter image description here">This might be a simple question, but I'm having trouble with it: In my web page, I have the following:</p> <pre><code>&lt;head&gt; &lt;!-- Stuff here --&gt; &lt;/head&gt; &lt;body&gt; &lt;header&gt; &lt;div class="content-wrapper"&gt; &lt;!-- More stuff here... --&gt; &lt;/div&gt; &lt;/header&gt; &lt;/body&gt; </code></pre> <p>where <code>content-wrapper</code> is in a css file and defines <code>max-width: 960px</code>. The problem I'm having is that the <code>max-width</code> has no effect in IE8. In the body, I have a table that I thought should be limited by the width defined in the <code>content-wrapper</code>, but in IE8 it just ignores it (but it works in Firefox).</p> <p>I tried a couple of different things, with no success:</p> <ul> <li><p>Added <code>style="max-width:960px"</code> to the </p></li> <li><p>Added <code>style="max-width:960px"</code> to the <code>&lt;tr&gt;</code> that is giving me grief</p></li> <li><p>Added <code>style="width:400px"</code> to the problematic <code>&lt;th&gt;</code> and <code>&lt;td&gt;</code> </p></li> </ul> <p>None of those worked in IE! Any ideas? What am I missing?</p> <p>New info:</p> <p>I put my table inside a div tag like this:</p> <pre><code>&lt;div style="border: 1px solid; width: 960px"&gt; &lt;!-- Table comes here --&gt; &lt;/div&gt; </code></pre> <p>As you see in the attached image, the div is being properly changed to have a border and the specified width, but the table just ignores it in IE8. In Firefox it works fine.</p>
 

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