Bootstrap responsive table not scrolling vertically on iOS devices

后端 未结 3 1825
闹比i
闹比i 2021-02-19 04:07

This is what I have:

....
&
相关标签:
3条回答
  • 2021-02-19 04:39

    This only makes tables scroll horizontally. Vertically scrolling with tables is not apart of Twitter Bootstrap.

    Check out their documentation for more information: Responsive Tables under the CSS Tab

    Source: http://getbootstrap.com/css/#tables

    0 讨论(0)
  • 2021-02-19 04:47

    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.

    0 讨论(0)
  • 2021-02-19 04:59

    I had the same problem then I removed overflow: hidden; from html and body. The behavior of Safari on IOS matched the behavior of Chrome on Android, ie, the page was scrolling vertically again. Check and see if a parent of .table-responsive has overflow-hidden and try commenting it out.

    I'm still looking for a better solution that will not force me to alter the CSS of parent elements.

    [EDIT]

    Found it. You don't need to change the overflow value on the parent of .table-responsive, just make sure you add

    parent {
        overflow-y: scroll; /* has to be scroll, not auto */
        -webkit-overflow-scrolling: touch;
    }
    
    0 讨论(0)
提交回复
热议问题