Sainath Nutakki wrote:
> I need a PDFP table and I do not want to borders on it , the below code 
> does not seem to accomplish what i want.
> can i anyone help me fix the code.

This is explained in chapter 6 of the book.

> PdfPTable tablex1=new PdfPTable(2);

You don't do anything with this line:
> tablex1.getDefaultCell().setBorder(Rectangle.NO_BORDER);
The above line is only valid when you use addCell with
a String or a Phrase.

> tablex1.setSpacingBefore(15f);
> tablex1.setTotalWidth(300);
> tablex1.setLockedWidth(true);
> 
> PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3"));
> cell.setBackgroundColor($hdr2BgColor);
> cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setBorder(Rectangle.NO_BORDER);
> tablex1.addCell(cell);
> 
> PdfPCell cell = new PdfPCell(new Paragraph("header with colspan 3"));
> cell.setBackgroundColor($hdr2BgColor);
> cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setBorder(Rectangle.NO_BORDER);
> tablex1.addCell(cell);
>
> document.add(tablex1);

Again: this is documented in the book.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to