static void create1stTable(HSLFSlide slide) { //six rows, two columns HSLFTable table1 = slide.createTable(6, 2); for (int i = 0; i < txt1.length; i++) { for (int j = 0; j < txt1[i].length; j++) { HSLFTableCell cell = table1.getCell(i, j); HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0); rt.setFontFamily("Arial"); rt.setFontSize(10d); if(i == 0){ cell.getFill().setForegroundColor(new Color(227, 227, 227)); } else { rt.setBold(true); } cell.setVerticalAlignment(VerticalAlignment.MIDDLE); cell.setHorizontalCentered(true); cell.setText(txt1[i][j]); } } DrawTableShape dts1 = new DrawTableShape(table1); dts1.setAllBorders(1.0, Color.black); table1.setColumnWidth(0, 300); table1.setColumnWidth(1, 150); int pgWidth = slide.getSlideShow().getPageSize().width; table1.moveTo((pgWidth - table1.getAnchor().getWidth())/2., 100.); }
dts.setAllBorders(1.0, Color.black); dts.setOutsideBorders(4.0);