【问题标题】:Table Cells occupy entire page in HTML表格单元格占据 HTML 中的整个页面
【发布时间】:2020-12-02 21:21:56
【问题描述】:

我正在尝试构建一个包含 6 列的表。我没有添加任何样式,但是所有单元格都占据了 100% 的宽度,使得表格显示为单列

<table>
  <thead>
    <tr>
      <th>Title 1</th>
      <th>Title 2</th>
      <th>Title 3</th>
      <th>Title 4</th>
      <th>Title 5</th>
      <th>Title 6</th>
    </tr>
  </thead>
  <tbody>
    {{#each projects}}
    <tr>
      <td>1</td>
      <td>2</td>
      <td>3</td>
      <td>4</td>
      <td>5</td>
      <td>6</td>
    </tr>
    {{/each}}
  </tbody>
</table>

【问题讨论】:

  • 显示你的代码。看起来你没有正确使用“td”和“tr”。
  • 加码哥
  • 你有造型吗?使用了任何 CSS 代码吗?你的 html 结构是正确的。
  • 我没用过任何css。
  • 这太奇怪了。尝试使用开发工具在浏览器中检查您的代码。或者 handlebars.js 可以有默认样式。

标签: html css node.js handlebars.js


【解决方案1】:

我找到了解决方案,我使用把手作为我的视图引擎,而把手不包含表格样式。它错过了 .所以添加 display: flex 完成了这项工作

【讨论】:

    猜你喜欢
    • 2017-08-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多