0
하나의 상위 테이블 인 table_body를 사용했습니다. sub_table 하나의 자식 테이블 (나는이 sub_table 부모 테이블에있는 PdfPCell 안에 넣고 싶습니다.). 내 요구 사항에 따라 행이 부모 테이블에 대해 완료되면 선을 그립니다. 그러나이 문제는 서브 테이블과 보편적 인 pdfPcell의 bottomborder입니다. 'body_cell_bottomBorder'가 한 직선으로 정렬되지 않습니다.하위 테이블 셀과 부모 테이블의 일반 pdfPcell에 대한 Bottomborder가 iTextPDF에서 하나의 직선을 이루지 않습니다
PdfPTable table_body = new PdfPTable(2); // main table
table_body.getDefaultCell().setBorder(Rectangle.NO_BORDER); // set border to none
table_body.setWidthPercentage(100.0f);
table_body.setWidths(new float[] {3.0f,1.0f,});
table_body.setSpacingBefore(6);
PdfPTable sub_table = new PdfPTable(1); // sub table
sub_table.getDefaultCell().setBorder(Rectangle.NO_BORDER); // set border to none
body_cell_bottomBorder.setPhrase(new Phrase("Example",font_body)); // this cell has the bottom border only
Image image = Image.getInstance(BarCode.createBarcode("example"));
body_cell = new PdfPCell(image, true); // this cell has no border at all
body_cell.setBorder(Rectangle.NO_BORDER);
sub_table.addCell(body_cell); // added one row in the sub table
sub_table.addCell(body_cell_bottomBorder); // added second row in the sub table and also want a bottom border
table_body.addCell(sub_table); // added subtable into the parent table pdfpcell
body_cell_bottomBorder.setPhrase(new Phrase(RPL,font_body)); // now adding second column value in parent table pdfPcell and want a bottom border only
table_body.addCell(body_cell_bottomBorder); // added to the parent table
문제는 부모 테이블의 두 셀이 내가 원하는 하나의 완전한 직선을 만들지 못한다는 것입니다.
고마워요. 그게 내 문제를 해결해 줬어. 고마워요 :) – Ani