Click here to Skip to main content
11,705,212 members (47,821 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# table itextsharp
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?
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 21-Feb-13 20:48pm
melvintcs1.1K

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

now still having problem with the width of each column
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 550
1 OriginalGriff 244
2 ppolymorphe 126
3 CPallini 82
4 F-ES Sitecore 70
0 OriginalGriff 8,988
1 Sergey Alexandrovich Kryukov 8,272
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100