I am creating a table in Apache Poi in xwpf using the below code :
XWPFTable table = doc.createTable(Countrows1+1,4);
table.getCTTbl().getTblPr().unsetTblBorders();
table.setInsideHBorder(XWPFTable.XWPFBorderType.DASHED, 0,0,null);
table.setInsideVBorder(XWPFTable.XWPFBorderType.DASHED,0,0, null);
/* table header */
table.getRow(0).getCell(0).setText("Column1");
table.getRow(0).getCell(1).setText("Column2");
table.getRow(0).getCell(2).setText("Column3");
table.getRow(0).getCell(3).setText("Column");
/* other rows to be populed here*/
I could not find any method using which we could align the table to left, centre or right of the page .Is there any way to do this?
Also the content of first row should be in bold . Is there any method to set the header as bold ?