Bootstrap 3 table - table-responsive not working

后端 未结 10 1193
攒了一身酷
攒了一身酷 2020-12-30 00:30

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

10条回答
  •  长发绾君心
    2020-12-30 01:15

    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.

提交回复
热议问题