title: adding cell of a table in itext
body: <p>why is the cell containing paragraph p not being added to table?</p>
  
  <pre><code>package iText;
  
  import java.io.FileOutputStream;
  import java.io.IOException;
  import com.itextpdf.text.Document;
  import com.itextpdf.text.*;
  import com.itextpdf.text.Paragraph;
  import com.itextpdf.text.Font.FontFamily;
  import com.itextpdf.text.pdf.PdfPCell;
  import com.itextpdf.text.pdf.PdfPTable;
  import com.itextpdf.text.pdf.PdfWriter;
  
  import java.io.FileOutputStream;
  
  public class NewMain1 {
      public static void main(String[] args) {
          Document document = new Document();
  
          try {
              PdfWriter.getInstance(document,
                  new FileOutputStream("C:\\Users\\om\\Desktop\\pdf\\2.pdf"));
  
              document.open();
  
              PdfPTable table = new PdfPTable(3); // 3 columns.
               Font font = new Font(FontFamily.HELVETICA, 22, Font.BOLD, BaseColor.WHITE);
          Paragraph p = new Paragraph("xyz", font);
          table.addCell("abc");    
          table.addCell(p);
  
              table.addCell("cef");
              table.addCell("ghi");
             // table.completeRow();
              PdfPCell cell1 = new PdfPCell(new Paragraph("Cell 1"));
              PdfPCell cell2 = new PdfPCell(new Paragraph("Cell 2"));
              PdfPCell cell3 = new PdfPCell(new Paragraph("Cell 3"));
  
              table.addCell(cell1);
              table.addCell(cell2);
              table.addCell(cell3);
  cell1.setHorizontalAlignment(Element.ALIGN_LEFT);
  
              document.add(table);
  
              document.close();
          } catch(Exception e){
  
          }
      }
  }
  </code></pre>
  
  <p>p.s I'm a newbie at this itext. It would be great if anyone could explain me how to generate pdf forms through itext. Thanks in advance :)</p>