title: Force HTML Tables To Not Exceed Their Containers' Size
body: <p>This question has been asked several times, but none of the answers provided seem to help me:</p>
  
  <p>See this in action here: <strong><a href="http://jsfiddle.net/BlaM/bsQNj/2/" rel="noreferrer">http://jsfiddle.net/BlaM/bsQNj/2/</a></strong></p>
  
  <p>I have a "dynamic" (percentage based) layout with two columns.</p>
  
  <pre><code>.grid {
      width: 100%;
      box-sizing: border-box;
  }
  .grid &gt; * {
      box-sizing: border-box;
      margin: 0;
  }
  .grid .col50 {
      padding: 0 1.5%;
      float: left;
      width: 50%;
  }
  </code></pre>
  
  <p>In each of these columns I have a table that is supposed to use the full column width. </p>
  
  <pre><code>.data-table {
      width: 100%;
  }
  .data-table td {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
  }
  </code></pre>
  
  <p>My problem is that some of the columns in that table have content that needs to be truncated to fit in the given width of the table. That does not happen, though. I get two tables that are overlaying each other.</p>
  
  <p>Requirements:</p>
  
  <ul>
  <li>Needs to be percentage based. I can't set absolute sizes.</li>
  <li>Each rows' height must not grow beyond one text line (which would happen if I remove white-space: nowrap)</li>
  <li>Must work in Chrome, Firefox and Internet Explorer 8+</li>
  <li>Can't display tables below each other as it has to fit onto one sheet of paper when printing.</li>
  </ul>
  
  <p>What I tried:</p>
  
  <ul>
  <li> inside of  and use width and overflow on that. Changed nothing.</li>
  <li>"display: table;" on containing div - instead of having two columns the tables were displayed below each other</li>
  <li>"table-layout: fixed;" - Forced all columns to have same width</li>
  <li>I know that columns 2+3 have a total of 30% of width so I tried to manually set column 1 to 70% - Did not change anything</li>
  <li><a href="https://stackoverflow.com/a/4650928/999">Zero-width spaces</a> in content - didn't change anything, probably due to white-space: nowrap;</li>
  </ul>
  
  <p>Related Questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/11531867/table-width-exceeds-containers-width">Table width exceeds container's width</a></li>
  <li><a href="https://stackoverflow.com/questions/1183676/how-do-i-prevent-my-html-table-from-stretching">How do I prevent my HTML table from stretching</a></li>
  <li><a href="https://stackoverflow.com/questions/1236148/html-css-how-to-stop-a-table-cell-from-expanding">HTML CSS How to stop a table cell from expanding</a></li>
  <li><a href="https://stackoverflow.com/questions/2259189/table-overflowing-outside-of-div">Table Overflowing Outside of Div</a></li>
  </ul>