C# itext表的外部边框

C# itext表的外部边框,c#,itext,C#,Itext,有没有办法使表格内的单元格不具有边框,而只具有外部边框 比如: ______________ | cell 1 c2 | | | |______________| 一,;我说的是iTextSharp Pdf库一个简单的解决方案是将单元格的边框宽度设置为0.0f,并更改第一行的上边框宽度、最后一行的下边框宽度以及第一列和最后一列的相同内容(分别使用左边框和右边框) (java代码,但应包含以下含义): for(int x=1,x for ( int x =

有没有办法使表格内的单元格不具有边框,而只具有外部边框

比如:

 ______________
| cell 1   c2  |  
|              |
|______________|

一,;我说的是iTextSharp Pdf库

一个简单的解决方案是将单元格的边框宽度设置为0.0f,并更改第一行的上边框宽度、最后一行的下边框宽度以及第一列和最后一列的相同内容(分别使用左边框和右边框)

(java代码,但应包含以下含义):

for(int x=1,x
for ( int x = 1, x <= xmax; x++){
   for ( int y = 1, y <= ymax; y++){
      // create the cell
      PdfPCell cell = new PdfPCell(pr);
      cell.setBorderWidth(0.0f);
      cell.setBorderColorBottom(Color.LIGHT_GRAY);
      // ... set the content of the cell here
      // and change the border(s) width
      if (x == 0)
         cell.setBorderWidthLeft(0.1f);
      if (x==xmax)
         cell.setBorderWidthRight(0.1f);
      if (y==0)
         cell.setBorderWidthTop(0.1f);
      if (y==ymax)
         cell.setBorderWidthBottom(0.1f);
      table.addCell(cell);
   }
}