title: jQuery UI resizable - resize table columns size with overflow
body: <p>I have a table with resizable columns implemented with jQuery UI Resizable. All working fine, except i can't change columns size narrowed than content. I can't use table-layout rule because after that rule table can't wider than window size. How to solve this?</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-js lang-js prettyprint-override"><code>$(function () {
    $("table th").resizable({
      minWidth: 100,
      resize: function (event, ui) {
        const sizerID = "#" + $(event.target).attr("id");
        const { width } = ui.size;
        $(sizerID).children("span").width(width);
      }
    });
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.table-holder {
    overflow: auto;
  }
  
  .table thead span {
    display: block;
  }
  .table tbody tr td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"&gt;
  &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css"&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"&gt;&lt;/script&gt;
  
  
  
  &lt;div class="table-holder"&gt;
    &lt;table class="table table-bordered table-striped"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th id="Company"&gt;&lt;span&gt;Company&lt;/span&gt;&lt;/th&gt;
          &lt;th id="Contact"&gt;&lt;span&gt;Contact&lt;/span&gt;&lt;/th&gt;
          &lt;th id="Country"&gt;&lt;span&gt;Country&lt;/span&gt;&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;tr&gt;
          &lt;td&gt;Alfreds Futterkiste&lt;/td&gt;
          &lt;td&gt;Maria Anders&lt;/td&gt;
          &lt;td&gt;Germany&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Centro comercial Moctezuma&lt;/td&gt;
          &lt;td&gt;Francisco Chang&lt;/td&gt;
          &lt;td&gt;Mexico&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Ernst Handel&lt;/td&gt;
          &lt;td&gt;Roland Mendel&lt;/td&gt;
          &lt;td&gt;Austria&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Island Trading&lt;/td&gt;
          &lt;td&gt;Helen Bennett&lt;/td&gt;
          &lt;td&gt;UK&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Laughing Bacchus Winecellars&lt;/td&gt;
          &lt;td&gt;Yoshi Tannamuri&lt;/td&gt;
          &lt;td&gt;Canada&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;Magazzini Alimentari Riuniti&lt;/td&gt;
          &lt;td&gt;Giovanni Rovelli&lt;/td&gt;
          &lt;td&gt;Italy&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p><code>Codepen demo</code>
  <a href="https://codepen.io/DenisDov/pen/WNwodEe" rel="nofollow noreferrer">https://codepen.io/DenisDov/pen/WNwodEe</a></p>