<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>合并单元格</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0px" align="center" width="400px">
<tr>
<!-- colspan:合并列 -->
<td colspan="2">11</td>
<!-- <td>12</td> -->
<td>13</td>
<td>14</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
</tr>
<tr>
<!-- rowspan:合并行 -->
<td rowspan="2">31</td>
<td>32</td>
<td colspan="2" rowspan="2">33</td>
<!-- <td>34</td> -->
</tr>
<tr>
<!-- <td>41</td> -->
<td>42</td>
<!--
<td>43</td>
<td>44</td>
-->
</tr>
</table>
</body>
</html>
关于合并单元格需要谨慎:合并单元格时,对其进行 colspan="2" 或 rowspan="2"时,需将其相关的单元格注释掉或者删掉,否则会出现单元格原位置被占用而向后移动的情况。