title: How to prevent Bootstrap 4 table-responsive to overflow it's parent
body: <p>I'm trying to use Bootstrap 4 <code>table table-responsive</code> classes to get table to show horizontal scrollbar so it doesn't overflow it's parent container when table's width is larger.</p>
  
  <p>However, the problem is it overflows it's parent container and doesn't show scrollbar at all.</p>
  
  <p><code>table-layout:fixed;</code> is not a solution as it fixes table's width instead of making it scrollable</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    background: #999;
    color: white;
    width: 100%;
  }
  
  .parent {
    display: flex;
    background: #333;
    width: 100%;
  }
  
  .div-with-table {
    flex: 1 1 auto;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="parent"&gt;
    &lt;div class="div-with-table"&gt;
      &lt;table class="table table-responsive"&gt;
        &lt;tr&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            xxxxx
          &lt;/td&gt;
          &lt;td&gt;
            xxxxx
          &lt;/td&gt;
          &lt;td&gt;
            xxxx
          &lt;/td&gt;
          &lt;td&gt;
            xxxx xxxx
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
          &lt;td&gt;
            x
          &lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://codepen.io/simPod/pen/PJPBEZ" rel="nofollow noreferrer">https://codepen.io/simPod/pen/PJPBEZ</a></p>
  
  <p>What am I doing wrong?</p>