XWPFTable . . , poi-3.9.jar, poi-ooxml-3.9.jar poi-ooxml-schemas-3.9.jar
XWPFTable table1 = document.createTable(1,1);
XWPFTable table2 = document.createTable(1,3);
spanCellsAcrossRow(table1, 0, 0, 6);
spanCellsAcrossRow(table2, 0, 0, 2);
spanCellsAcrossRow(table2, 0, 1, 2);
spanCellsAcrossRow(table2, 0, 2, 2);
private void spanCellsAcrossRow(XWPFTable table, int rowNum, int colNum, int span) {
XWPFTableCell cell = table.getRow(rowNum).getCell(colNum);
cell.getCTTc().getTcPr().addNewGridSpan();
cell.getCTTc().getTcPr().getGridSpan().setVal(BigInteger.valueOf((long)span));
}