html - th 表标签的默认行为

标签 html css materialize

<分区>


关闭 7 年前

在大屏幕上,我的表格 TH 位于顶部,但当我在移动设备上运行它时,这些 TH 位于左侧。这是 TH of tables 的默认行为吗?我正在使用“响应表”的 Matrialize css 类。

  <table class="responsive-table">
    <thead>
      <tr>
          <th data-field="id">Name</th>
          <th data-field="name">Item Name</th>
          <th data-field="price">Item Price</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>Alvin</td>
        <td>Eclair</td>
        <td>$0.87</td>
      </tr>
      <tr>
        <td>Alan</td>
        <td>Jellybean</td>
        <td>$3.76</td>
      </tr>
      <tr>
        <td>Jonathan</td>
        <td>Lollipop</td>
        <td>$7.00</td>
      </tr>
    </tbody>
  </table>

最佳答案

是的,这是添加 responsive-table 类时的默认行为。文档指出:

Add class="responsive-table" to the table tag to make the table horizontally scrollable on smaller screen widths.

养成检查文档的习惯!我从未使用过物化,但我通过搜索他们的网站很快找到了答案。

来源:Tables in materialize.css

关于html - th 表标签的默认行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37062305/

上一篇:javascript - 一定宽度的裁剪跨度

下一篇:css - Flexslider 将视口(viewport)渲染为 1px

相关文章:

html - Bootstrap 按钮文本不可见

javascript - javascript/jQuery 有没有办法永久存储数据?

javascript - 如何使用 Materialise 触发选择更改

javascript - 制作两个不同颜色的 Materialise 开关

c# - 需要有关 z-index 属性的帮助

javascript - PhantomJS 将 HTML 转换为 JPEG : Image is cut off

html - 为什么散焦时底部会出现一些超标?

css - CSS 中的列未按预期嵌套

css - block 元素被下推到下一行

javascript - 奇怪的CSS位置问题