diff --git a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/gfse/GFSETable.java b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/gfse/GFSETable.java index 73c197616..efef35b25 100644 --- a/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/gfse/GFSETable.java +++ b/validation-model/src/main/java/org/verapdf/gf/model/impl/pd/gfse/GFSETable.java @@ -271,13 +271,17 @@ private Integer getNumberOfColumns(GFPDStructElem firstTR) { private Integer getNumberOfRows(List listTR) { int numberOfRows = 0; - for (GFPDStructElem TR : listTR) { - List children = TR.getStructuralSignificanceChildren(); + for (int rowNumber = 0; rowNumber < listTR.size(); rowNumber++) { + List children = listTR.get(rowNumber).getStructuralSignificanceChildren(); if (!children.isEmpty()) { PDStructElem elem = children.get(0); String type = elem.getstandardType(); if (TaggedPDFConstants.TH.equals(type) || TaggedPDFConstants.TD.equals(type)) { - numberOfRows += ((GFSETableCell)elem).getRowSpan(); + Long rowSpan = ((GFSETableCell)elem).getRowSpan(); + numberOfRows += rowSpan; + if (rowSpan > 1) { + rowNumber += rowSpan - 1; + } } } }