When XSLFTextParagraph is added to XSLFTableCell and when new TextRun is added to the paragraph, text in the cell starts from second line in the cell. We can see that when PPT is opened. this issue is not letting us utilize vertical space and accommodate more rows.
Please add an example - I can't reproduce your issue on the trunk. Tested with Libre Office. > @Test > public void bug63558() throws Exception { > XMLSlideShow ppt = new XMLSlideShow(); > XSLFSlide slide = ppt.createSlide(); > XSLFTable tab = slide.createTable(4,3); > tab.setAnchor(new Rectangle2D.Double(50,50,500,500)); > for (int x=0; x<4; x++) { > for (int y=0; y<3; y++) { > XSLFTableCell cell = tab.getCell(x, y); > // Variant 1 > // cell.setText("("+x+","+y+")"); > // Variant 2 > cell.addNewTextParagraph().addNewTextRun().setText("("+x+","+y+")"); > } > } > new DrawTableShape(tab).setAllBorders(2., Color.BLACK, StrokeStyle.LineDash.LG_DASH); > try (FileOutputStream fos = new FileOutputStream("blub.pptx")) { > ppt.write(fos); > } > }
No response in quite some time, so we close this for now, please provide more information if this is still a problem for you.