复杂 HTML table 未验证:table 行 "exceeded the column count established by the first row"
Complex HTML table not validating: table row "exceeded the column count established by the first row"
validator.w3.org 给我错误:
A table row was 4 columns wide and exceeded the column count established by the first row (1).
看起来像这样:
|1|2.1|2.2 |
| |3.1|3.2|3.3|
| |4.1|4.4|4.5|
<table>
<tbody>
<tr>
<td rowspan="4"> 1 </td>
</tr>
<tr>
<td> 2.1 </td>
<td colspan="2"> 2.2 </td>
</tr>
<tr>
<td> 3.1 </td>
<td> 3.2 </td>
<td> 3.3 </td>
</tr>
<tr>
<td> 4.1 </td>
<td> 4.2 </td>
<td> 4.3 </td>
</tr>
</tbody>
</table>
我简化了数据,代码来自艾萨克·牛顿爵士的自然哲学的数学原理,显然他不明白HTMLtable规则比我做的更好。
您必须合并前两行并更改第一个字段的行跨度:
<table>
<tbody>
<tr>
<td rowspan="3"> 1 </td>
<td> 2.1 </td>
<td colspan="2"> 2.2 </td>
</tr>
<tr>
<td> 3.1 </td>
<td> 3.2 </td>
<td> 3.3 </td>
</tr>
<tr>
<td> 4.1 </td>
<td> 4.2 </td>
<td> 4.3 </td>
</tr>
</tbody>
</table>
validator.w3.org 给我错误:
A table row was 4 columns wide and exceeded the column count established by the first row (1).
看起来像这样:
|1|2.1|2.2 |
| |3.1|3.2|3.3|
| |4.1|4.4|4.5|
<table>
<tbody>
<tr>
<td rowspan="4"> 1 </td>
</tr>
<tr>
<td> 2.1 </td>
<td colspan="2"> 2.2 </td>
</tr>
<tr>
<td> 3.1 </td>
<td> 3.2 </td>
<td> 3.3 </td>
</tr>
<tr>
<td> 4.1 </td>
<td> 4.2 </td>
<td> 4.3 </td>
</tr>
</tbody>
</table>
我简化了数据,代码来自艾萨克·牛顿爵士的自然哲学的数学原理,显然他不明白HTMLtable规则比我做的更好。
您必须合并前两行并更改第一个字段的行跨度:
<table>
<tbody>
<tr>
<td rowspan="3"> 1 </td>
<td> 2.1 </td>
<td colspan="2"> 2.2 </td>
</tr>
<tr>
<td> 3.1 </td>
<td> 3.2 </td>
<td> 3.3 </td>
</tr>
<tr>
<td> 4.1 </td>
<td> 4.2 </td>
<td> 4.3 </td>
</tr>
</tbody>
</table>