html - Bootstrap v4.0.0-alpha.3 移动 View 中的表回流问题

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

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

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>

最佳答案

我有使用媒体查询的解决方案。希望它可以帮助你。 检查 CODEPLY链接

CSS:

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

关于html - Bootstrap v4.0.0-alpha.3 移动 View 中的表回流问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39169317/

相关文章:

jquery - Bootstrap 下拉菜单在单击选择框时关闭

javascript - 在 AngularJS 中只运行一次某些代码

html - 对齐 CSS 切换开关

HTML CSS 如何改变边框形状

html - 将包含另一个带有内联 block 的 div 的 div 居中

twitter-bootstrap - 使用 box-sizing : border-box with Twitter Bootstrap 2. x,我们可以在不破坏一切的情况下轻松做到吗?

css - 如何模糊 bootstrap css 描述的元素?

php - 清理 PHP/HTML 页面

javascript - 如何在 Javascript 中取消绑定(bind)按钮上的现有点击事件并将其替换为新事件

html - col-md-3 显示不正确