tbl.setTblGrid(tblGrid);
protected void setupTblGrid(TableBox cssTable, Tbl tbl, TableProperties tableProperties) { // Word can generally open a table without tblGrid: // <w:tblGrid> // <w:gridCol w:w="4621"/> // <w:gridCol w:w="4621"/> // </w:tblGrid> // but for an AutoFit table (most common), it // is the w:gridCol val which prob specifies the actual width TblGrid tblGrid = Context.getWmlObjectFactory().createTblGrid(); tbl.setTblGrid(tblGrid); int[] colPos = tableProperties.getColumnPos(); log.debug("setupTblGrid " + cssTable.numEffCols() + " " + colPos.length); for (int i=1; i<=cssTable.numEffCols(); i++) { TblGridCol tblGridCol = Context.getWmlObjectFactory().createTblGridCol(); tblGrid.getGridCol().add(tblGridCol); log.debug("colpos=" + colPos[i]); tblGridCol.setW( BigInteger.valueOf(colPos[i]-colPos[i-1]) ); } }
tbl.setTblGrid(tblGrid);