我使用iText 2.1.0版創建PDF。我必須在表格的單元格中創建一個「細節」單元格。我在這個單元格內嵌入了一張桌子。這種方法的問題是嵌套表的邊框不會觸及容器單元的邊界。我在尋找的是嵌套在單元格內的表格,這些單元格的邊界與嵌套的表格邊界沒有區別。單元格內的iText嵌套表
我有一個這樣的測試。我在一個循環內部將一個單元格中的表格添加到外部表格中:
PdfPCell testCell = new PdfPCell(new Paragraph("Test"));
//I want this border to touch the containerCell borders.
testCell.setBorder(PdfPCell.BOTTOM);
testTable = new PdfPTable(2);
testTable.addCell(testCell);
testTable.addCell(testCell);
testTable.addCell(testCell);
testTable.addCell(testCell);
PdfPCell containerCell = new PdfPCell();
containerCell.addElement(testTable);
outerTable.addCell(containerCell);
謝謝。
爲什麼是C1那裏,但沒有提到?這是需要的嗎? – 2014-08-21 11:51:06
我想是一個錯字。它應該是最可能的c2。我會修好它。 – Averroes 2014-08-22 06:11:30