Li Wang,
I think it would be easier if you added the total row to the bottom of the
first table.
I don't know how you are adding the cells to your table - using defaultcell
or adding a new cell, but you can add a top border like this:
Cell.Border = iTextSharp.text.Rectangle.NO_BORDER
Cell.BorderTop = 1
Cell.BorderColorTop = itextsharp.text.color.BLACK
Then add cell to table - table.AddCell(cell)
If you want to have extra space on the last line of the detail row you can
set the cell.paddingbottom = ?
This has the advantage of keeping all the columns the same size in the main
table and the total row. If you had two different tables they might
calculate the column widths differently if you did not use a fixed column
size.
Rick
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Li Wang
Sent: Monday, August 11, 2008 6:11 PM
To: [email protected]
Subject: [iText-questions] adding a line between 2 table rows
I am building a table with rows of records and a total row at the end
and try to add a line to separate the total with the rest of the records.
Here is the sample layout, but without the blank row space:
DataOne DataTwo DataThree
row1 11 52 15
row2 22 21 45
_________________________________
total 33 73 60
In order to do that, I set the borderColorTop of each cell in the total row
being black and the other (bottom, left and right) borders being white,
hoping it will add a black line at the top of the total cells/row.
Here is the code:
cell.setBorderColorTop(new Color(0,0,0)); //black
cell.setBorderColorBottom(new Color(255,255,255)); //white
cell.setBorderColorLeft(new Color(255,255,255));
cell.setBorderColorRight(new Color(255,255,255));
However, it ended up with each border of each cell in the total row has a
black line, not just the top border. Do you have any idea how this can
happen or is there any better way to implement a line between 2 rows?
Thank you,
-Li Wang
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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