如何在这样的html中创建一个表

时间:2017-05-18 13:59:36

标签: html html-table

我想创建一个这样的表: -

这只是一个样本

     ______________________________________________________________
    |               |                      |         |            |
    |               |______________________|         |            |
    |               |        |             |         |            |
    |               |________|_____________|         |            |
    |               |           |          |         |            |
    |_______________|___________|__________|_________|____________|

1 个答案:

答案 0 :(得分:0)

您可以使用rowspancolspan属性。

rowspan指定单元格应跨越的行数。即<td rowspan='2'></td>指定单元格应跨越2行。

colspan指定单元格应跨越的列数。即<td colspan='2'></td>指定单元格应跨越2列。

<table>
  <tr>
    <th rowspan="3"></th>
    <th colspan="5"></th>
    <th rowspan="3"></th>
    <th rowspan="3"></th>
  </tr>
  <tr>
     <td colspan="2"></td>
     <td colspan="3"></td>
  </tr>
  <tr>
    <td colspan="3"></td>
    <td colspan="2"></td>
  </tr>
</table>
相关问题