我使用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