如何使单元格变高并跨越两行?

3

我有一个表格,希望将其中一行的单元格高度变高,使其与其他单元格不同,并且在下一行中,该单元格会从上一行的第一个单元格向右延伸。

目前我的代码如下:

<table>
  <tr>
    <th colspan="4">aaaaaaaa</th>
  </tr>
  <tr>
    <td want this one to be two rows high>a</td>
    <td>a</td>
    <td>a</td>
    <td>a</td>
  </tr>
  <tr> //want this row to fit in the right of top row
    <td>b</td>
    <td>b</td>
    <td>b</td>
  </tr>
</table>

2
你可能正在寻找 rowspan 属性。看一下这个链接:https://dev59.com/dmkw5IYBdhLWcg3wiq-s - Jeff B
1个回答

0

我希望这是你所需要的

<table>
  <tr>
    <th colspan="1" >aaaaaaaa</th>
  </tr>
  <tr>
    <td></td>
    <td>a</td>
    <td>a</td>
    <td>a</td>
  </tr>
  <tr> <!--want this row to fit in the right of top row-->
    <td></td>
    <td>b</td>
    <td>b</td>
    <td>b</td>
  </tr>
</table>

1
我后来找到了,我要找的是 rowspan,不过还是谢谢你! - user3203711

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接