html - 划分底行以匹配表中的顶行 - HTML

标签 html css html-table

我想对表格进行一些格式化,但我似乎无法弄清楚如何将底行平均划分为与顶行具有相同的宽度。

我希望顶行像 240 像素一样,并将底行分成两部分,每部分 120 像素。

下图供引用:
enter image description here

<table>
<tbody>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>

我们将不胜感激!

更新:
enter image description here enter image description here

这就是我在使用 colspan 时遇到的问题:

<table>
    <tbody>
        <tr>
            <td colspan="2">Content</td>
        </tr>
        <tr>
            <td>Column 1</td>
            <td>Column 2</td>
        </tr>
    </tbody>
</table>

最佳答案

看看这个:

 th, td {
  border: 1px solid black;
 }   
 td{
 width:240px;
 }
 
<body>
<table>      
<tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <th>&nbsp;</th>
    <th>&nbsp;</th>
  </tr>
</table> 
</body>

关于html - 划分底行以匹配表中的顶行 - HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57166522/

相关文章:

javascript - navigator.clipboard.readText() 在 Firefox 中不起作用

java - 如何让人们可以点击按钮1次?

css - Woocommerce 图片 - 添加图片宽度

javascript - 使用 jquery 更新表行中的总数

jQuery 克隆倒数第二行并插入到表末尾

html - viewport iphone4/4s 和媒体查询

php - MySQL:如果表中不存在变量,如何回显文本?

php - 仅在被询问时显示反馈

html - 对齐按钮以与字段集对齐

javascript - 为 AngularJS 中的列分配颜色