title: How to ensure table cells in fixed head are in same width with cells in scrollable body?
body: <p>My HTML for the table is like this <strong><code>(in tbody, data is loaded from an ajax call)</code></strong>:</p>
  
  <pre><code>&lt;table class="table table-sm table-bordered text-center"&gt;
      &lt;thead class="text-center text-white"&gt;
          &lt;tr&gt;
              &lt;td&gt;Country&lt;/td&gt;
              &lt;td&gt;Crop&lt;/td&gt;
              &lt;td&gt;Trials&lt;/td&gt;
              &lt;td&gt;Nurseries&lt;/td&gt;
              &lt;td&gt;Unspecified&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody id="country-crop-trials"&gt;&lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>And my CSS is like this</p>
  
  <pre><code>::-webkit-scrollbar {
      width: 5px;
      height: 5px;
  }
  
  ::-webkit-scrollbar-track {
      background: white;
  }
  
  ::-webkit-scrollbar-thumb {
      background: black;
  }
  
  thead{
      display: block;
      background-color: #08381f;
      display: table;
      width: calc(100% - 5px);
  }
  
  tbody {
      display: block;
      max-height: 360px;
      width: calc(100% - 5px);
      overflow-y: scroll;
  }
  </code></pre>
  
  <p>And my table displays like this:
  <a href="https://i.stack.imgur.com/izCtd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/izCtd.png" alt="enter image description here"></a></p>
  
  <p>I tried changing some style properties but cannot get it right. Someone please help me so that the columns in table head align with columns in table body</p>