我正在使用 iText 2.1.0 版创建 PDF。我必须在表格的单元格中创建一个“详细信息”单元格。我这样做是在该单元格内嵌套一个表格。这种方法的问题是嵌套表格的边界不接触容器单元格的边界。我正在寻找的是嵌套在单元格内的表格,其边框与嵌套表格边框没有区别。
我有一个像这样的测试。我在循环中执行此操作以将单元格内的表格添加到外部表格:
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);
谢谢。