我将如何擦除或使我使用 table.completeRow() 完成的单元格的边框不可见

how will I erase or to make the border invisible of the cell that I completed using table.completeRow()

这是我的代码,我在其中为商户列创建了一个不可见的边框并完成了该行,商户列没有边框,但该行的其余部分有,我不知道如何使其不可见。

PdfPCell cellMerchantTitle = rowCellStyle("Merchant", fontTitleSize);
cellMerchantTitle.setColspan(2);
table.addCell(cellSystemTitle);
table.completeRow();

public PdfPCell rowCellStyle(String cellValue, Font fontStyle){
PdfPCell cell = new PdfPCell(new Paragraph(cellValue, fontStyle));
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setBorder(Rectangle.NO_BORDER);
return cell;
}

我已经试过了

table.getDefaultCell().setBorder(Rectangle.NO_BORDER);

添加 table.getDefaultCell().setBorder(Rectangle.NO_BORDER); 应该可以解决问题,但您必须确保在 之前添加此行 完成该行:

table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
PdfPCell cellMerchantTitle = rowCellStyle("Merchant", fontTitleSize);
cellMerchantTitle.setColspan(2);
table.addCell(cellSystemTitle);
table.completeRow();