Hello Jason,
I am able to alter the width of the table column but not able to set the height of the table row.
How to change the height of the row?
Regards,
Sharad
File reportFile = new File(System.getProperty("user.dir"), "Draft Report.docx");
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.createPackage();
Tbl jpegTable = TblFactory.createTable(0, 0, 8000);
jpegTable = setTableWidth(jpegTable, 8700);
Tr tableRow1 = objectFactory.createTr();
Tr tableRow2 = objectFactory.createTr();
jpegTable.getEGContentRowContent().add(tableRow1);
jpegTable.getEGContentRowContent().add(tableRow2);
wordMLPackage.getMainDocumentPart().addObject(jpegTable);
private static Tbl setTableWidth(Tbl tbl, long width){
TblPr tblPr = objectFactory.createTblPr();
TblWidth tblWidth = objectFactory.createTblWidth();
tblWidth.setW(BigInteger.valueOf(width));
tblWidth.setType("dxa"); // twips
tblPr.setTblW(tblWidth);
tbl.setTblPr(tblPr);
return tbl;
}
Users browsing this forum: Google [Bot] and 98 guests