ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,451 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The following code writes Name and then Department in the next line right below the Name.
How do I modify this code to write Department in the same line with a Tab separator?
table.AddCell(PhraseCell(new Phrase("Name:", FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.BOLD, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
table.AddCell(PhraseCell(new Phrase(name, FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.NORMAL, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
cell = PhraseCell(new Phrase(), PdfPCell.ALIGN_CENTER);
cell.Colspan = 2;
cell.PaddingBottom = 10f;
table.AddCell(cell);
table.AddCell(PhraseCell(new Phrase("Department:", FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.BOLD, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
table.AddCell(PhraseCell(new Phrase("HCVP Voucher Program", FontFactory.GetFont("Arial", 8, iTextSharp.text.Font.NORMAL, BaseColor.BLACK)), PdfPCell.ALIGN_LEFT));
cell = PhraseCell(new Phrase(), PdfPCell.ALIGN_CENTER);
cell.Colspan = 2;
cell.PaddingBottom = 10f;
table.AddCell(cell);
Never mind!
I've fixed it with:
cell.Rowspan = 4;