bootstrap 3 table column width code example

Example 1: bootstrap table col fixed width

<table class="table">
  <thead>
    <tr>
      <th style="width: 30%">Col 1</th>
      <th style="width: 20%">Col 2</th>
      <th style="width: 10%">Col 3</th>
      <th style="width: 30%">Col 4</th>
      <th style="width: 10%">Col 5</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Val 1</td>
      <td>Val 2</td>
      <td>Val 3</td>
      <td>Val 4</td>
      <td>Val 5</td>
    </tr>
  </tbody>
</table>

Example 2: bootstrap table dense

<!-- BOOTSTRAP V3 -->
<table class="table table-condensed">
  ...
</table>
<!-- BOOTSTRAP v4 -->
<table class="table table-sm">
  ...
</table>

Tags:

Misc Example