删除 table 单元格之间的白色 space

Remove white space between table cells

我正在使用 ITextSharp 5.5.7。我有以下代码,一切正常。但是,我需要删除每个单元格之间的白色 space 。我已经尝试了找到的所有建议,但仍然没有删除白色 space。这是代码:

private PdfPTable createTable()
        {

            // Table (No border, just to hold all objects)
            PdfPTable sheetTable = new PdfPTable(1);
            sheetTable.WidthPercentage = 100;
            sheetTable.DefaultCell.Border = iTextSharp.text.Rectangle.NO_BORDER;
            sheetTable.SpacingBefore = 0f;
            sheetTable.SpacingAfter = 0f;

            // Add Heading One
            sheetTable.AddCell(createHeadingOne());

            // Add Heading two
            sheetTable.AddCell(createHeadingTwo());

            return sheetTable;

        }


        private PdfPTable createHeadingOne()
    {

        PdfPCell cell = new PdfPCell();

        PdfPTable headingTable = new PdfPTable(2);

        // Set widths of columns
        int[] headingTablewidths = { 50, 50 }; // percentage
        headingTable.SetWidths(headingTablewidths);

        cell = new PdfPCell(new Phrase("col1row1", FontFactory.GetFont(FontFactory.HELVETICA, 8, BaseColor.BLACK)));
        headingTable.AddCell(cell);

        cell = new PdfPCell(new Phrase("col2row1", FontFactory.GetFont(FontFactory.HELVETICA, 8, BaseColor.BLACK)));
        headingTable.AddCell(cell);

        return headingTable;

    }

    private PdfPTable createHeadingTwo()
    {

        PdfPCell cell = new PdfPCell();

        PdfPTable headingTable = new PdfPTable(2);

        // Set widths of columns
        int[] headingTablewidths = { 50, 50 }; // percentage
        headingTable.SetWidths(headingTablewidths);

        cell = new PdfPCell(new Phrase("col1row2", FontFactory.GetFont(FontFactory.HELVETICA, 8, BaseColor.BLACK)));
        headingTable.AddCell(cell);

        cell = new PdfPCell(new Phrase("col2row2", FontFactory.GetFont(FontFactory.HELVETICA, 8, BaseColor.BLACK)));
        headingTable.AddCell(cell);

        return headingTable;

    }

更新 #1 蓝线是我需要删除间距的区域:

更新 #2,已修复。这是 Bruno 提供的代码:

PdfPCell cell;
cell = new PdfPCell(createHeadingOne());
cell.Padding = 0;
sheetTable.AddCell(cell);
cell = new PdfPCell(createHeadingTwo());
cell.Padding = 0;
sheetTable.AddCell(cell);

我会这样解决:

PdfPCell cell;
cell = new PdfPCell(createHeadingOne());
cell.Padding = 0;
sheetTable.AddCell(cell);
cell = new PdfPCell(createHeadingTwo());
cell.Padding = 0;
sheetTable.AddCell(cell);