Html 表colspan&;行距

Html 表colspan&;行距,html,html-table,Html,Html Table,我对colspan和rowspan有点问题。我试着做下表: 但我被困在第二个副标题的行跨度: <table border="1"> <tr> <th colspan="3"><h1>DIVING</h1></th> </tr> <tr> <td colspan="2">col 1 row 1</td>

我对
colspan
rowspan
有点问题。我试着做下表:

但我被困在第二个副标题的行跨度:

<table border="1">
      <tr>
        <th colspan="3"><h1>DIVING</h1></th>
      </tr>
      <tr>
        <td colspan="2">col 1 row 1</td>
        <td>col 1 row 1</td>
      </tr>

      <tr>
        <td>col 1 row 1</td>
        <td>col 1 row 1</td>
        <td>col 1 row 1</td>
      </tr>


</table>

潜水
第1列第1行
第1列第1行
第1列第1行
第1列第1行
第1列第1行
当我将第二个
与所讨论的
放在一起时,它紧跟在第一个副标题之后,而不是第二个副标题:


从图像中,看起来您有4列(而不是3列)。试试这样的东西

<table>
    <tr>
        <th colspan="4"><h1>DIVING</h1></th>
    </tr>
    <tr>
        <td colspan="2">col 1&2 row 2</td>
        <td colspan="2">col 3&4 row 2</td>
    </tr>
    <tr>
        <td>col 1 row 3</td>
        <td>col 2 row 3</td>
        <td>col 3 row 3</td>
        <td>col 4 row 3</td>
    </tr>
</table>

潜水
第1列和第2列第2行
第3列和第4列第2行
第1列第3行
第2列第3行
第3列第3排
第4列第3行
然后重复第三行,复制第二行作为最后一行


从图像中,看起来您有4列(而不是3列)。试试这样的东西

<table>
    <tr>
        <th colspan="4"><h1>DIVING</h1></th>
    </tr>
    <tr>
        <td colspan="2">col 1&2 row 2</td>
        <td colspan="2">col 3&4 row 2</td>
    </tr>
    <tr>
        <td>col 1 row 3</td>
        <td>col 2 row 3</td>
        <td>col 3 row 3</td>
        <td>col 4 row 3</td>
    </tr>
</table>

潜水
第1列和第2列第2行
第3列和第4列第2行
第1列第3行
第2列第3行
第3列第3排
第4列第3行
然后重复第三行,复制第二行作为最后一行