I'm not sure if I am using useVariableBorders() correctly, or what, but if I set useVariableBorders for the cell with the different border width, the outside of the table doesn't line up with the cell (see cell_variableborders.pdf). If I turn on variableBorders for all the cells, I get double borrder on the cells (see all_variableborders.pdf). Is there something else that needs to happen to get the borders to work with a cell with a different border like this?
 

 
[C#]
 
PdfPTable table = new PdfPTable(new float[] {1f,1f,1f});
table.DefaultCell.UseAscender = true;
table.DefaultCell.UseDescender = true;   
table.DefaultCell.UseVariableBorders = true;
 
PdfPCell header = new PdfPCell();
header.AddElement(new Chunk("header with colspan 3"));
header.Colspan = 3;
header.UseAscender = true;
header.UseDescender = true;
header.UseVariableBorders = true;
table.AddCell(header);
 
PdfPCell c = new PdfPCell();
c.AddElement(new Chunk("1.1"));   
c.BorderWidth = 10f;
c.UseBorderPadding = true;
c.UseAscender = true;
c.UseDescender = true;
c.UseVariableBorders = true;
table.AddCell(c);
 
table.AddCell("2.1");
table.AddCell("3.1");
table.AddCell("1.2");
table.AddCell("2.2");
table.AddCell("3.2");
 

 
Thanks,
 
-Mitch
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mitch Freed
Sent: Tuesday, November 01, 2005 1:33 PM
To: [email protected]
Subject: RE: [iText-questions] PdfPTable Cell Borders

Just found it -- useVariableBorders(bool)
 
Thanks,
 
-Mitch
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mitch Freed
Sent: Tuesday, November 01, 2005 1:17 PM
To: [email protected]
Subject: [iText-questions] PdfPTable Cell Borders

I have a table(PdfPTable) using a border and have specified one cell to use a large border width. I have the BorderPadding set to True (setUseBorderPadding), which sets the padding to include the border width -- that's working great. The border of the cell however, moves into and outside of the table's area (it's an outside cell in this case). Is there anyway to tell the table or cell to keep the border within the cell? I am attaching the example pdf and code.
 

 
[C#]
 
PdfPTable table = new PdfPTable(new float[] {1f,1f,1f});
table.DefaultCell.UseAscender = true;
table.DefaultCell.UseDescender = true;
 
PdfPCell header = new PdfPCell();
header.AddElement(new Chunk("header with colspan 3"));
header.Colspan = 3;
header.UseAscender = true;
header.UseDescender = true;
table.AddCell(header);
 
PdfPCell c = new PdfPCell();
c.AddElement(new Chunk("1.1"));
c.BorderWidth = 10f;
c.UseBorderPadding = true;
c.UseAscender = true;
c.UseDescender = true;
table.AddCell(c);
 
table.AddCell("2.1");
table.AddCell("3.1");
table.AddCell("1.2");
table.AddCell("2.2");
table.AddCell("3.2");
 

 
Thanks,
Mitch Freed

Attachment: cell_variableborders.pdf
Description: cell_variableborders.pdf

Attachment: all_variableborders.pdf
Description: all_variableborders.pdf

Reply via email to