← back to articles

❯ cat itextsharp-create-table.md

ITextSharp Create Table

1 min readtr#C##Create Table

ItextSharp'da Tablo oluşturmak için yazmış olduğum bir extension method...

public PdfPTable CreateTable(PdfPTable table, PdfPCell cell, int row, int column)
{
    table = new PdfPTable(row + column);

    for (int i = 0; i < column; i++)
    {
        for (int j = 0; j < row; j++)
        {
            cell = new PdfPCell(new Phrase((i + 1).ToString() + " " + (j + 1).ToString()));
            table.AddCell(new Phrase(i + j));
        }
    }
    table.SpacingAfter = 10f;

    return table;
}