.`(该行列位置的 `| `/` | ` 与当前 `header` 模式冲突)
- **错误类型**:`XmlWikiConversionError`
- **问题原因**:`header="row"` 要求第 1 行全是 ` | `、其余行全是 ` | `;`header="col"` 要求第 1 列全是 ` | `;`header="both"` 要求第 1 行与第 1 列全是 ` | `;`header="none"`(或省略)要求全是 ` | `。
错误写法:
```xml invalid
1
示例
```
修正写法:使表头行与 `header="row"` 完全对齐。
```xml
1
示例
```
## 表格行结构错误(缺行、行宽属性、非法文本与非法子元素)
包含五条消息:
- `Complex tables must contain at least one | .`
- `Row-level width is not supported; use the table widths attribute instead.`(在 `
` 上写了 `width` 属性)
- `Unexpected text directly inside a table row.` / `Unexpected trailing text inside a table row.`
- `Unsupported tag inside .`(例如在 `
` 中直接写了 `` 或 ``)
- `Complex tables must contain at least one column.` / `Complex tables must contain at least one row and one column.`
- **错误类型**:`XmlWikiConversionError`
- **问题原因**:复杂表格没有 `` 或没有有效单元格列;在 `
` 上写了不支持的 `width` 属性;或在 `
` 内直接放置了 `| `/` | ` 之外的文本或元素。
错误写法:
```xml invalid
1
示例
```
修正写法:删除 ` |
` 上的 `width` 属性,统一通过 `` 的 `widths` 控制列宽。
```xml
1
示例
```
## 列宽推导失败、列宽数量不匹配与非正数值
包含六条消息:
- `Complex tables require a chapter size to derive default widths.`(在 `` 等非章节上下文中省略了 `widths`)
- `Unsupported chapter size '' for default table widths.`(在 `` 中省略了 `widths`,但 `size` 不是 `large`、`middle` 或 `small`)
- `Table widths count does not match logical column count .`
- `Complex table column widths length does not match column count .`
- `Table width '' for column is not numeric.`
- `Table column width must be a positive number.` / `Complex table column width must be a positive number.`
- **错误类型**:`XmlWikiConversionError`
- **问题原因**:未满足默认列宽推导条件却省略了 `widths`,或者显式 `widths` 中的项数与表格逻辑列数不等,或包含非数字、0 或负数。
错误写法:
```xml invalid
1
示例
```
修正写法:在 `` 中显式写出与列数相等的正数 `widths`。
```xml
1
示例
```
## 网格几何错误(坐标、跨度越界与缺口)
包含八条消息:
- `Expected integer for .` / `Expected positive integer for .`(`rowspan`、`colspan`、`col` 不是正整数)
- `Complex table cell positions must be non-negative.`
- `Complex table cell spans must be positive integers.`
- `Complex table cell row span exceeds the table bounds.`
- `Complex table cell column span exceeds the table bounds.`
- `Complex table contains uncovered grid positions.`
- **错误类型**:`XmlWikiConversionError`
- **问题原因**:单元格的 `rowspan`/`colspan`/`col` 不是正整数、跨行跨列超出了表格总行数或总列数,或者某行少写了单元格导致矩形网格中存在未被任何单元格覆盖的空洞。
错误写法:
```xml invalid
1
示例
```
修正写法:补全第二行的第二个单元格,或为第一格设置 `colspan="2"` 铺满整行。
```xml
1
示例
```
## JSON 表格单元格标识错误
包含两条仅在 JSON 解析阶段触发的消息:
- `Invalid table cell id ''.`:JSON 中 `cellMap` 的键名格式不是 `_`(缺少下划线分隔符)。
- `Unknown table cell position ''.`:JSON 中 `cellMap` 的 `` 或 `` 不存在于表格的 `rowIds` / `columnIds` 数组中。
- **错误类型**:`XmlWikiConversionError`
- **修复方式**:核对上游 Wiki JSON 的 `table.rowIds`、`table.columnIds` 与 `table.cellMap` 键名是否一致。
## 另见
- [`` 复杂表格](../../elements/table/):查阅属性说明与网格规则
- [标题、段落、引用与列表](../../elements/headings-and-text-blocks/):查阅 ``/``/`- ` 规范
- [编写表格条目](../../guides/tables/):通过可运行示例演练表格构建与排错