'How to modify PdfPCell so that you can remove a part of a border (e.g BOTTOM, TOP, LEFT)?
Here an example of my code:
PdfPCell row6cell_1 = new PdfPCell(row6Par_1);
row6cell_1.setBorder(Rectangle.NO_BORDER);
row6cell_1.setBorder(Rectangle.LEFT);
row6cell_1.setBorder(Rectangle.TOP);
row6cell_1.setBorder(Rectangle.BOTTOM);
row6cell_1.setBorderWidth(1.0f);
I want to modify the border of the cell so that the RIGHT border line of the cell will not appear. Anyone can help me with this? Thank you.
Solution 1:[1]
You can try this: This is for removing the bottom border only.
Cell = new PdfPCell(new Phrase("001"));
Cell.setBorder(Rectangle.TOP | Rectangle.RIGHT | Rectangle.LEFT);
Solution 2:[2]
cell.DisableBorderSide(1);//(1-Top,2-Bottom,3-left and 4-Right border) Enjoy it for removing part of cell's border..
Solution 3:[3]
Pappoo Singh answer is good but for me works:
cell.DisableBorderSide(x)
where x can be:
x - 1 //top
x - 2 //bottom
x - 4 //left
x - 8 //right
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Pappoo Singh |
Solution 3 | Hakens |