C# ITEXT清除单元格之间的间距
我试着在一行中添加三个单元格,它们有相同颜色的彩色背景。问题是我看到了这些单元格之间的空间(或垂直边界),但我不需要这个空间 正如你在图片上看到的,有一些空间。也许这是做我需要的事情的错误方式。我需要这个绿色的文本在页面的中心,白色的文本在右边的同一行和相同的背景色 这是我的代码:C# ITEXT清除单元格之间的间距,c#,.net,itext,C#,.net,Itext,我试着在一行中添加三个单元格,它们有相同颜色的彩色背景。问题是我看到了这些单元格之间的空间(或垂直边界),但我不需要这个空间 正如你在图片上看到的,有一些空间。也许这是做我需要的事情的错误方式。我需要这个绿色的文本在页面的中心,白色的文本在右边的同一行和相同的背景色 这是我的代码: PdfPCell emptyCell = new PdfPCell(); emptyCell.BackgroundColor = BaseColor.DARK_GRAY; emptyCell
PdfPCell emptyCell = new PdfPCell();
emptyCell.BackgroundColor = BaseColor.DARK_GRAY;
emptyCell.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
emptyCell.VerticalAlignment = Element.ALIGN_CENTER;
emptyCell.MinimumHeight = 30f;
emptyCell.Colspan = 3;
emptyCell.Border = Rectangle.NO_BORDER;
_currentTable.AddCell(emptyCell);
iTextSharp.text.Font clubFont = new iTextSharp.text.Font(Font.FontFamily.HELVETICA, 12, Font.NORMAL, new BaseColor(0.541f, 0.765f, 0f));
PdfPCell cell = new PdfPCell();
Paragraph clubName = new Paragraph(clubString, clubFont) {Alignment = Element.ALIGN_CENTER};
cell.AddElement(clubName);
cell.BackgroundColor = BaseColor.DARK_GRAY;
cell.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
cell.VerticalAlignment = Element.ALIGN_CENTER;
cell.MinimumHeight = 30f;
cell.Colspan = _currentTable.NumberOfColumns - 6;
cell.Border = Rectangle.NO_BORDER;
_currentTable.AddCell(cell);
iTextSharp.text.Font dispFont = new iTextSharp.text.Font(Font.FontFamily.HELVETICA, 10, Font.NORMAL, BaseColor.WHITE);
PdfPCell dispCell = new PdfPCell();
Paragraph dispersion = new Paragraph(dispersionString, dispFont);
dispersion.Alignment = Element.ALIGN_CENTER;
dispCell.AddElement(dispersion);
dispCell.HorizontalAlignment = Element.ALIGN_JUSTIFIED;
dispCell.VerticalAlignment = Element.ALIGN_CENTER;
dispCell.MinimumHeight = 30f;
dispCell.Colspan = 3;
dispCell.BackgroundColor = BaseColor.DARK_GRAY;
dispCell.Border = Rectangle.NO_BORDER;
_currentTable.AddCell(dispCell);