This is what I have:
<div class="table-responsive">
<table class="table" style="background: transparent">
....
</table>
</div>
I am using the following bootstrap.css file: http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css
When I try to scroll up and down on an iOS device (while my finger is touching the table), it doesn't scroll. It just drags the whole page up and down. I have to touch the body background or any other object, other than the table, in order to scroll. This problem doesn't come up in Android devices, but it seems to be there on iOS devices, like iPhone.
I tried adding overflow-y: auto
to <div class="table-responsive">
, but it still didn't work.
What do I need to add in order to enable scrolling on mobile devices (Apple devices, specifically)?
You can make any table responsive across all viewports by wrapping a . table with . table-responsive class. Or, pick a maximum breakpoint with which to have a responsive table up to by using .
On the table you now need to enable flex box by adding the class d-flex , and drop the xs to allow bootstrap to automatically detect the viewport. Table column width use the same layout as grids do; using col-[viewport]-[size] . Remember the column sizes should total 12; 1 + 3 + 3 + 5 = 12 in this example.
Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive across all viewports by wrapping a . table with . table-responsive .
For anyone else having this problem, all I had to do to solve it was to add the following line to the css of the table-responsive class:
-webkit-overflow-scrolling: touch;
And now it works as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With