html合并单元格

在合并的首位置加上colspan或者rowspan属性即可
code:
<html>
 
<body>
 
<h4>横跨两列的单元格:</h4>
<table border="1">
<tr>
  <th>姓名</th>
  <th colspan="2">电话</th>
</tr>
<tr>
  <td>Bill Gates</td>
  <td>555 77 854</td>
  <td>555 77 855</td>
</tr>
</table>
 
<h4>横跨两行的单元格:</h4>
<table border="1">
<tr>
  <th>姓名</th>
  <td>Bill Gates</td>
</tr>
<tr>
  <th rowspan="2">电话</th>
  <td>555 77 854</td>
</tr>
<tr>
  <td>555 77 855</td>
</tr>
</table>
 
</body>
</html>
效果图:
HTML表格中的单元格合并 - 我不是神 - 我不是神的博客
原文地址:https://www.cnblogs.com/syxxlove/p/3833796.html