title: width of table header for bootstrap fixed header
body: <p>I am trying to keep the header fixed and scroll the body part. But I am facing the problem regarding the width of table header. Is there any way to solve the problem without assigning the pre-defined width because for long headers the width will be a problem overlapping the next header?</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>.fixed_headers {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }
  
  .fixed_headers thead {
    background-color: #333;
    color: #FDFDFD;
  }
  .fixed_headers thead tr {
    display: block;
   
  }
  .fixed_headers tbody {
    display: block;
    overflow: auto;
    width: 100%;
    height: 300px;
  }
  .fixed_headers tbody tr:nth-child(even) {
    background-color: #DDD;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;table class=" table table-bordered  fixed_headers"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Color&lt;/th&gt;
        &lt;th&gt;Description of it &lt;/th&gt;
             &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Color&lt;/th&gt;
        &lt;th&gt;Description&lt;/th&gt;
             &lt;th&gt;Name&lt;/th&gt;
        &lt;th&gt;Color&lt;/th&gt;
        &lt;th&gt;Description&lt;/th&gt;
        
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Apple&lt;/td&gt;
        &lt;td&gt;Red&lt;/td&gt;
        &lt;td&gt;These are red.These are red.&lt;/td&gt;
         &lt;td&gt;Apple&lt;/td&gt;
        &lt;td&gt;Red&lt;/td&gt;
        &lt;td&gt;These are red.&lt;/td&gt;
      &lt;/tr&gt;
      
      &lt;tr&gt;
        &lt;td&gt;Pear&lt;/td&gt;
        &lt;td&gt;Green&lt;/td&gt;
        &lt;td&gt;These are green.&lt;/td&gt;
         &lt;td&gt;Apple&lt;/td&gt;
        &lt;td&gt;Red&lt;/td&gt;
        &lt;td&gt;These are red.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Grape&lt;/td&gt;
        &lt;td&gt;Purple / Green&lt;/td&gt;
        &lt;td&gt;These are purple and green.&lt;/td&gt;
         &lt;td&gt;Apple&lt;/td&gt;
        &lt;td&gt;Red&lt;/td&gt;
        &lt;td&gt;These are red.&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Orange&lt;/td&gt;
        &lt;td&gt;Orange&lt;/td&gt;
        &lt;td&gt;These are orange.&lt;/td&gt;
         &lt;td&gt;Orange&lt;/td&gt;
        &lt;td&gt;Orange&lt;/td&gt;
        &lt;td&gt;These are orange.&lt;/td&gt;
      &lt;/tr&gt;
     
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>