I use PdfPTable in the following way
var myTable = new PdfPTable( 3 );
foreach(var nextString in myStrings)
{
var nextCell = new PdfPCell( new Phrase( next
The CompleteRow()
method will do the thing. This adds an empty cell at the end of your PDF, but you will notice it displays an empty cell with border. So, in order to avoid this behaviour, you will have to set DefaultCell.Border = Rectangle.NO_BORDER
before calling the CompleteRow()
method.
var myTable = new PdfPTable( 3 );
foreach(var nextString in myStrings)
{
var nextCell = new PdfPCell( new Phrase( nextString, smallFont ) );
nextCell.Border = Rectangle.NO_BORDER;
nextCell.AddCell(nextCell);
}
myTable.DefaultCell.Border = Rectangle.NO_BORDER;
myTable.CompleteRow();
pdfDocument.Add(myTable);