我正在使用 iTextSharp 生成表格,我想制作 Pdfcells 的通用而不是手动添加
PdfPCell HeadCell0 = new PdfPCell(new Paragraph("FullName", Htitle));
HeadCell0.BackgroundColor = Color.LIGHT_GRAY;
PdfPCell HeadCell1 = new PdfPCell(new Paragraph("Username", Htitle));
HeadCell1.BackgroundColor = Color.LIGHT_GRAY;
PdfPCell HeadCell2 = new PdfPCell(new Paragraph("Email", Htitle));
HeadCell2.BackgroundColor = Color.LIGHT_GRAY;
PdfPCell HeadCell3 = new PdfPCell(new Paragraph("Department", Htitle));
HeadCell3.BackgroundColor = Color.LIGHT_GRAY;
PdfPCell HeadCell4 = new PdfPCell(new Paragraph("AddedBy", Htitle));
HeadCell4.BackgroundColor = Color.LIGHT_GRAY;
PdfPCell HeadCell5 = new PdfPCell(new Paragraph("Account Type", Htitle));
HeadCell5.BackgroundColor = Color.LIGHT_GRAY;