RapidMod

Bootstrap 4 Table Column Width Example

Jan 26th, 2017 (edited)
1,055
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.82 KB | None | 0 0
  1. <!-- The container width must be set -->
  2. <div class="col-md-12">
  3.     <!-- Migrating from bootstrap 3 "table-responsive" could cause display issues -->
  4.     <table class="table table-responsive table-striped table-hover table-sm">
  5.         <!-- set the columns in the head to avoid repeated code in the rows -->
  6.         <thead>
  7.         <!-- the tr must be set to row and optionally width depending on your needs -->
  8.             <tr class="row col-xs-12">
  9.                 <!-- Now you can set the column widths -->
  10.                 <th class="col-xs-9">Location</th>
  11.                 <th class="col-xs-3">Actions</th>
  12.             </tr>
  13.         </thead>
  14.         <tbody>
  15.             <!-- In some cases I have also had to set the column rows -->
  16.             <tr class="row col-xs-12">
  17.                 <td class="col-xs-9">...</td>
  18.                 <td class="col-xs-9">...</td>
  19.             </tr>
  20.         </tbody>
  21.     </table>
  22. </div>
  23. <a href="https://rapidmod.io/">Rapidmod.io</a>
Advertisement
Add Comment
Please, Sign In to add comment