Click here to Skip to main content
15,889,556 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
this is how i create my table, the table is created and post into pdf. this table have 5 rows and 5 columns.
the problem i having is the table showing at the top of the pdf, i have some title and description at the top, how can i manually set the position of the table?

and also how can i resize the width of each column?
C#
PdfPTable table = new PdfPTable(5);
PdfPTable pdft;
            
for (int j = 1; j < 6; j++)
{
   for (int i = 1; i < 6; i++)
   {                    
       pdft = new PdfPTable(1);
       pdft.WidthPercentage = 100f;
       pdft.DefaultCell.Border = 0;
                    
       pdft.AddCell("C" + j.ToString() + i.ToString());
                    
       table.AddCell(pdft);
   }
}
pdfDoc.Add(table);
Posted

1 solution

Solved, for positioning, use
C#
Paragraph paragraphTable = new Paragraph();
paragraphTable.SpacingAfter = 10f;


now still having problem with the width of each column
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900