你好,在读取如图的表格中 合并的单元格 444 时,根据以下代码读取不到水平方向的合并属性,
其中的cellFormat.getHorizontalMerge() 值为0 ,说明不是合并的单元格,但实际已经是合并的了
Table child = (Table)doc.getChild(NodeType.TABLE, 1, true);
RowCollection rows = child.getRows();
for (Row row : rows)
{
CellCollection cells = row.getCells();
for (Cell cell : cells)
{
String text = cell.getText();
CellFormat cellFormat = cell.getCellFormat();
// horizontalMerge 值为0
int horizontalMerge = cellFormat.getHorizontalMerge();
int verticalMerge = cellFormat.getVerticalMerge();
System.out.println(text);
}
System.out.println("================================");
}