Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

To Place row bottom border in a table

$
0
0
Hi,

I want to place a bottom border for a row. I have used the below code the same is not working.Please suggest how this can be acheived.

Table table1 = new Table(sec);
table1.setColumnWidths("100% ");
table1.setBackgroundColor(subjectDtl);
table1.setDefaultCellBorder(new BorderInfo(BorderSide.Left | BorderSide.Right, 0.7F, black));
table1.setBorder(new BorderInfo(BorderSide.All, 0.7F));
MarginInfo margin = new MarginInfo();
margin.setTop(0.7f);
margin.setLeft(0.7f);
margin.setRight(0.7f);
margin.setBottom(0.7f);

//Set the default cell padding to the MarginInfo object
table1.setDefaultCellPadding(margin);
Row row1 = table1.getRows().add();
row1.setVerticalAlignment(VerticalAlignmentType.Center);
row1.setDefaultCellTextInfo(cellInfo1);
row1.getCells().add("row1");
        
       
       
       Row row2 = table1.getRows().add();
       row2.setVerticalAlignment(VerticalAlignmentType.Center);
       row2.setDefaultCellTextInfo(cellInfo2);
       row2.setBorder(new BorderInfo(BorderSide.Bottom, 0.7F, black));
row2.getCells().add("row2");

       
       Row row3 = table1.getRows().add();
row3.setVerticalAlignment(VerticalAlignmentType.Center);
row3.setDefaultCellTextInfo(cellInfo1);
row3.setBorder(new BorderInfo(BorderSide.Top, 0.7F, black));
row3.getCells().add("row3");
        
       Row row4 = table1.getRows().add();
row4.setVerticalAlignment(VerticalAlignmentType.Center);
row4.setDefaultCellTextInfo(cellInfo2);
row4.getCells().add("row4");
        

Viewing all articles
Browse latest Browse all 3131

Trending Articles