I have a code, but it\'s for rowspan a table. Can you help me to convert this to colspan code?
private static void mergeCellVertically(XWPFTable table, int c
private static void mergeCellHorizontally(XWPFTable table, int row, int fromCell, int toCell){
for(int cellIndex = fromCell; cellIndex <= toCell; cellIndex++){
XWPFTableCell cell = table.getRow(row).getCell(cellIndex);
if(cellIndex == fromCell){
// The first merged cell is set with RESTART merge value
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.RESTART);
}else{
// Cells which join (merge) the first one, are set with CONTINUE
cell.getCTTc().addNewTcPr().addNewHMerge().setVal(STMerge.CONTINUE);
}
}
}