Hiding table border in iTextSharp

前端 未结 6 697
忘了有多久
忘了有多久 2020-12-28 12:03

How can i hide the table border using iTextSharp. I am using following code to generate a file:

var document = new Document(PageSize.A4, 50, 50, 25, 25);

//         


        
6条回答
  •  萌比男神i
    2020-12-28 12:49

    First we can set all cell borders as 0 and After assigning all cell to table we can use the following code for for only pdfptable outer border.

            PdfPCell cell = new PdfPCell();
            cell.AddElement(t);
            cell.BorderWidthBottom=1f;
            cell.BorderWidthLeft=1f;
            cell.BorderWidthTop=1f;
            cell.BorderWidthRight = 1f;
            PdfPTable t1 = new PdfPTable(1);
            t1.AddCell(cell);
    

    Here we can add table to one cell and can set border and again add that cell to another table and we can use as per our requirement.

提交回复
热议问题