I have a two paragraphd in one table.I want to align the paragraph.
One paragraph in left another paragraph in right..
I will done my align but its not correct alignment.
The paragraph shouls starting in a same position.Like this
My requeired Output is:
aspnet Java
Java asp.net
My output is
Asp.net java
java asp.net
So my Alignmnet is not good to look ...
Please Share how to Alignment the paragrapn

Sandip G PatilRank #1,083 · 1.8K reputationPosted Mar 20, 2017, 1:51 AM EDT
using (FileStream fs = new FileStream("TableTest.pdf", FileMode.Create)) { Document doc = new Document(PageSize.A4); PdfWriter.GetInstance(doc, fs); doc.Open(); PdfPTable table = new PdfPTable(4); table.WidthPercentage = 50.0f; // Options: Element.ALIGN_LEFT (or 0), Element.ALIGN_CENTER (1), Element.ALIGN_RIGHT (2). table.HorizontalAlignment = Element.ALIGN_LEFT; for (int i = 1; i 20; i++) { PdfPCell cell = new PdfPCell(new Phrase(String.Format("Cell # {0}", i))); cell.FixedHeight = 30.0f; cell.HorizontalAlignment = Element.ALIGN_LEFT; cell.VerticalAlignment = Element.ALIGN_MIDDLE; table.AddCell(cell); } doc.Add(table); doc.Close(); }table.HorizontalAlignment = 1;
1:center
0:left
2:right