mardi 21 juin 2016

How to add multiple checkbox into an itext table cell

hello i have a maintable called data. i want to a checkboxs in my cell of marrital status. i have tried looking arround all blogs but i cant get the right approach. am new to itext java pdf but really need help. below is a look of code.i want each cell element to appear with a checkbox besides it . please help.

  PdfPCell c9;
     PdfPTable checboxtable = new PdfPTable(2);
      PdfPCell c27 = new PdfPCell();
      c27.addElement(new Phrase("8.Sex"));
       c27.addElement(new Phrase("male"));
        c27.addElement(new Phrase("female"));
        checboxtable.addCell(c27);
         PdfPCell c28 = new PdfPCell();
          c28.addElement(new Phrase("9.Marital Status"));

       c28.addElement(new Phrase("Married"));
        c28.addElement(new Phrase("Single"));
          c28.addElement(new Phrase("Sperated"));
        c28.addElement(new Phrase("Divorsed"));
          c28.addElement(new Phrase("widow(er)"));
           c28.addElement(new Phrase("others"));
        checboxtable.addCell(c28);
        c9 = new PdfPCell (checboxtable);
          c9.setPadding(0);
         data.addCell(c9);




Aucun commentaire:

Enregistrer un commentaire