title: How to create a full width table with fixed height and scrolling in Bootstrap?
body: <p>I am quite new in bootstrap, so I am sorry if my question is too simple.</p>
  
  <p>I want to create a table that has a width as the parent container, fixed height and scroll bar if the table contains too many rows.</p>
  
  <p>I have tried to do it like this:</p>
  
  <pre><code>&lt;table class="table"&gt;
      &lt;tbody style="height: 80px; overflow-y: auto;"&gt;
          &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>It displays full table with full width but without scrolling and the height is bigger than I need.</p>
  
  <p>Also I've tried to add <code>display: block;</code>:</p>
  
  <pre><code>&lt;table class="table"&gt;
      &lt;tbody style="height: 80px; display: block; overflow-y: auto;"&gt;
          &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>In this case the scroll bar appeared but the width of tr-tag doesn't fit the container, it's much shorter.</p>
  
  <p>I have also tried to specify <code>width=100%</code> to <code>tr</code> and <code>td</code> tags without a luck. How am I supposed to solve my task?</p>