Re: [iText-questions] How to set border around PdfPTable?

2014-03-26 Thread jomgrg


First we can set all cell borders as 0 and After assigning all cell to table
we can use the following code for for only pdfptable outer border.

PdfPCell cell = new PdfPCell();
cell.AddElement(t);
cell.BorderWidthBottom=1f;
cell.BorderWidthLeft=1f;
cell.BorderWidthTop=1f;
cell.BorderWidthRight = 1f;
PdfPTable t1 = new PdfPTable(1);
t1.AddCell(cell);

Here we can add table to one cell and can set border and again add that cell
to another table and we can use as per our requirement.




--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/How-to-set-border-around-PdfPTable-tp3549165p4659883.html
Sent from the iText - General mailing list archive at Nabble.com.

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php


Re: [iText-questions] How to set border around PdfPTable?

2011-05-25 Thread 1T3XT BVBA
On 25/05/2011 10:30, Hiren Parghi wrote:
 Hi,

 Is there any way to set border around the table.
 In earlier version of iText, we can get border around table using 
 following code:

 Table table = new Table(3);
 table.setBorderWidth(2);

 But in PdfPTable there is no such method to set border around table(We 
 want to display border around table not around individual cell).
Please read the book: http://itextpdf.com/book/

For individual cells: see chapter 4.
Cell borders are defined at the level of a PdfPCell.
Depending on how you add cells to a PdfPTable,
you should set the border of the default cell;
that is: PdfPTable.getDefaultCell();
Or you should set the border of every PdfPCell object
added to the PdfPTable.

For the complete table (not the cells):
Use a PdfPTable event as is done in chapter 5.

--
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
___
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php