问题
I have declared a table with 50 columns and I pass only 40 column data. In this case pdf not generates .Pdf generates, only if I pass 50 column data. how can I solve this issue? I found a function to solve this problem but I forget that function name. Anybody help me...
eg: it works,
PdfPTable table1 = new PdfPTable(50);
for (int i = 1; i <=50; i++)
{
table1.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
table1.AddCell(new Phrase(new Phrase("100", font4)));
}
which is not working is,
PdfPTable table1 = new PdfPTable(50);
for (int i = 1; i <=40; i++)
{
table1.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
table1.AddCell(new Phrase(new Phrase("100", font4)));
}
回答1:
I solved this problem using table1.CompleteRow();
in the last line. The o/p is,

Hope it helps some one...
来源:https://stackoverflow.com/questions/31448592/how-to-generate-pdf-if-our-column-less-than-the-declared-table-column