Hi

How to set the width of the PdfPTable in JSP. When I use  pdfptable.setTotalWidth(500); its working fine when I execute the example.. but whereas when I use this in my JSP the width is not setting the width is always fixed though I increase or decrease.. could you plz help me in this.

    PdfPTable pdfptable = new PdfPTable(5);
// MyTableEvent event = new MyTableEvent();
// pdfptable.setTableEvent(event);
   pdfptable.setTotalWidth(500);
   pdfptable.getDefaultCell().setBorder(Rectangle.NO_BORDER);

   PdfPCell pdfpcell = new PdfPCell(new Phrase("Column 1",fonts[1]));
   pdfptable.addCell(pdfpcell);
   pdfpcell = new PdfPCell(new Phrase("Column 2",fonts[1]));
   pdfptable.addCell(pdfpcell);
   pdfpcell = new PdfPCell(new Phrase("Column 3",fonts[1]));
   pdfptable.addCell(pdfpcell);
   pdfpcell = new PdfPCell(new Phrase("Column 4",fonts[1]));
   pdfptable.addCell(pdfpcell);
   pdfpcell = new PdfPCell(new Phrase("Column 5",fonts[1]));
   pdfptable.addCell(pdfpcell);
   document.add(pdfptable);

Thanks

Sridhar

 



Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Reply via email to