I\'m using bootstrap 3 for a website project. I\'m trying to create a page with a responsive table, so that I\'d have the scrollbar when the table is too big. I made a test
You're code is fine. I just set up a fiddle here.
Works there!
I literally copied and pasted your code. Are you sure your links to Bootstrap's Javascript file and CSS file are working?
<div class="row">
<h4>Nuværende kurser</h4>
<div class="col-12 col-sm-12 col-lg-12">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Table heading</th>
<th>Table heading</th>
<th>Table heading</th>
<th>Table heading</th>
<th>Table heading</th>
<th>Table heading</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
</tr>
<tr>
<td>2</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
</tr>
<tr>
<td>3</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
<td>Table cell</td>
</tr>
</tbody>
</table>
</div>
</div><!-- end col-12 -->
</div><!-- end row -->
Try this
remove <div class="table-responsive">...</div>
and move class table-responsive in <div class="col-12 col-sm-12 col-lg-12">
example
<div class="col-12 col-sm-12 col-lg-12 table-responsive">
this 100% work but if dont work move class table-responsive to Earlier Div layer,
In this case,
<div class="col-12 col-sm-12 col-lg-12">
must be removed.
In my code, I did add a CSS class:
.modal-body{
max-width:95vw;
}
The layout did work for sm
For me it was the 'min-width' value in body element breaking the responsiveness of this class.