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 can use FooTable. It is a jQuery plugin that allows you to resize and redistribute the data within your tables to best suite your current breakpoint.
Make sure to set your table display block
.table {
display: block !important;
}
bootstrap's table-responsive works fine in sandbox environments, but it is buggy on live environments. The reason for the bug is that bootstrap gives table-responsive styles of width: 100% and overflow-y: hidden. These two styles do not play nice together. Overflow hiding works best when there is a fixed or max-width. I gave table-responsive a max-width: 270px; for mobile devices, and that fixed the bug.
I'v done it.
<div style="display: table">
<div style="display: table-row">
<div style="display: table-cell">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
//wrapper that will give opportunity to use: overflow-x: auto;
<table style="table-layout: fixed; width: 100%;">
<tr>
<td>
//SCROLL
<div style="width: 100%; overflow-x: auto;">
//table, that shoud have "table-responsive" bootstrap class effect
<table class="table table-hover">
//...table content...
</table>
</div>
<td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
You will receive at xs-screen (example from my app):
I had this problem and found that it worked to either give the table a set width in px, or to set the table to display: block.
Replace your table-responsive with this
<div class='table-responsive'> -> <div style="overflow-x:auto;">