title: Fixed table header on window scroll
body: <p>I have a simple Bootstrap table with a lot of rows.
  Is there a way to make the table header be fixed when scrolling the window, but have the width of each column header to equal the width of the row with the most text.
  Because when setting table header position to fixed, then the header doesn't change its width based off the content.
  In other words set width of each column dependent on widest value (be that title in the header or value in a cell) in the column.
  Is there a way to put such calculations on the header column width ?
  I cant think of any other way to do this.
  I am using angular.</p>
  
  <p>Here's a jsfiddle of what I've tried when setting position of header row to fixed : <a href="http://jsfiddle.net/adsrr8ss/1/" rel="nofollow noreferrer">JsFiddle</a>
  As you can see now the columns don't align with the appropriate columns in the body.
  I need them to be aligned, but without setting a fixed width for every column, since I do not know how long the data I'm getting will be.</p>
  
  <p>HTML code: </p>
  
  <pre><code>&lt;div class="col-md-12 tableDiv"  &gt;
   &lt;table class="table table-striped" &gt;
    &lt;thead class="table-bordered"&gt;
      &lt;tr&gt;
        &lt;th&gt;Column1&lt;/th&gt;
        &lt;th&gt;Column2&lt;/th&gt;
        &lt;th&gt;Column3&lt;/th&gt;
        &lt;th&gt;Column4&lt;/th&gt;
        &lt;th&gt;Column5&lt;/th&gt;
        &lt;th&gt;Column6&lt;/th&gt;
  
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody &gt;
      &lt;tr&gt;
        &lt;td &gt; FIRST&lt;/td&gt;
        &lt;td &gt;asdasdfasf&lt;/td&gt;
        &lt;td &gt;fsdf&lt;/td&gt;
        &lt;td&gt;sdfsfd&lt;/td&gt;
        &lt;td&gt;sdfs&lt;/td&gt;
        &lt;td&gt;fsdfsdf&lt;/td&gt;
      &lt;/tr&gt;
          &lt;tr&gt;
        &lt;td &gt; asdf&lt;/td&gt;
        &lt;td &gt;asdfa&lt;/td&gt;
        &lt;td &gt;fsdf&lt;/td&gt;
        &lt;td&gt;sdfsfd&lt;/td&gt;
        &lt;td&gt;sdfs&lt;/td&gt;
        &lt;td&gt;fsdfsdf&lt;/td&gt;
      &lt;/tr&gt;
          &lt;tr&gt;
        &lt;td &gt; asdf&lt;/td&gt;
        &lt;td &gt;asdfa&lt;/td&gt;
        &lt;td &gt;fsdf&lt;/td&gt;
        &lt;td&gt;sdfsfd&lt;/td&gt;
        &lt;td&gt;sdfs&lt;/td&gt;
        &lt;td&gt;fsdfsdf&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
    &lt;/div&gt;
  &lt;div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Css:</p>
  
  <pre><code>.table-bordered tr {
    position: fixed;
     z-index:1;
    top: 50px;
    background: #fff;
   }
  </code></pre>