Cómo combinar una tabla en Word con APACHE POI
Tengo un código, pero es para la fila de una tabla. ¿Me pueden ayudar a convertir esto a código colspan?
private static void mergeCellVertically(XWPFTable table, int col, int fromRow, int toRow){
for(int rowIndex = fromRow; rowIndex <= toRow; rowIndex++){
XWPFTableCell cell = table.getRow(rowIndex).getCell(col);
if(rowIndex == fromRow){
// The first merged cell is set with RESTART merge value
cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.RESTART);
}else{
// Cells which join (merge) the first one, are set with CONTINUE
cell.getCTTc().addNewTcPr().addNewVMerge().setVal(STMerge.CONTINUE);
}
}
}