Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have table with 6 cells. I make property table.KeepTogether = true;. How add padding to top of table?

C#
var table = new PdfPTable(6);  
            table.SplitLate = true;
            table.SplitRows = true;
            table.DefaultCell.Padding = 2; // Not work
            table.KeepTogether = true;
 var widths = new[] { 3.4f, 2.7f, 1.5f, 1.5f, 1.5f, 2f };
            table.SetWidths(widths);


That i have now
http://i.stack.imgur.com/rYYHZ.png[^]

That i want make
http://i.stack.imgur.com/rBljw.png[^]
Posted
Updated 21-Oct-20 23:40pm

 
Share this answer
 
Use set margins.

pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
pdfDoc.SetMargins(20f, 20f, 20f, 20f);

You can change the padding size according to your need.
 
Share this answer
 

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