void (final @NotNull Project project, List<TableRow> table, int columnNumber) { for (int i = 0; i < table.size(); i++) { TableRow row = table.get(i); if (row.isEmpty()) { XmlTag element = createTableCellXmlTag(project, row.insideHeader); row.rowTag.add(element); } else if (columnNumber < 0) { TableCell cell = null; for (int j = 0; j < row.size(); j++) { TableCell currentCell = row.get(j); if (currentCell.startRow == i) { cell = currentCell; break; } } if (cell != null) { addCellToTag(project, cell, true, row.insideHeader); } } else { loop: for (int j = Math.min(columnNumber, row.size() - 1); j >= 0; j--) { TableCell cell = row.get(j); for (XmlAttribute attribute : cell.tag.getAttributes()) { if (COLSPAN.equals(StringUtil.toLowerCase(attribute.getLocalName()))) { if (cell.startRow == i) { try { cell.tag.setAttribute(COLSPAN, String.valueOf((Integer.parseInt(cell.tag.getAttributeValue(COLSPAN)) + 1))); } catch (NumberFormatException e) { break; } } break loop; } } if (cell.startRow == i) { addCellToTag(project, cell, false, row.insideHeader); break; } } } } }