移动视图中的Bootstrap v4.0.0-alpha.3表重排问题

时间:2016-08-26 15:02:50

标签: html css twitter-bootstrap twitter-bootstrap-4 bootstrap-4

我在移动视图中尝试以下代码无法修复移动视图中的表格重排问题。任何建议都将得到真正的重视

See image here

查看CODEPEN

处的代码
<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <table class="table table-reflow">
        <thead>
          <tr>
            <th>Id</th>
            <th>Employee Name</th>
            <th>Salary</th>
            <th>Bonus</th>
            <th>Total</th>
          </tr>
        </thead>
        <tbody>
          <tr scope="row">
            <td>665</td>
            <td>Amit Shah</td>
            <td>10000</td>
            <td>1000</td>
            <td>11000</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

2 个答案:

答案 0 :(得分:0)

这似乎是BS4 alpha中的一个已知问题: https://github.com/twbs/bootstrap/issues/20510

一种解决方法是为表设置固定宽度,以防止它被包装。

http://www.codeply.com/go/WX8ByNRqMy

答案 1 :(得分:0)

我使用媒体查询为您提供解决方案。希望它可以帮到你。 查看CODEPLY链接

CSS:

@media (max-width: 544px) {
  .table-reflow thead,
  .table-reflow thead tr,
  .table-reflow tbody tr {
    width: 100%;
  }
}