This project has moved. For the latest updates, please go here.

How to set table border to none? (for 2 rows only)

Feb 20, 2013 at 12:39 PM
Hi, first thanks for providing a useful tool it is awsome

I am using it with C# and successfully generating some tables. But I need to
remove borders for the top and last row as they must not have any borders
the rest is working fine, so please help me removing the borders of the first row
and the last row (assume the table rows between 3 and 4)
Feb 21, 2013 at 4:35 AM
I have solved it using following code:
    private void RemoveTopBorders(Row row)
    {
        Border t = new Border(Novacode.BorderStyle.Tcbs_none, BorderSize.one, 1, Color.White);
        Border l = new Border(Novacode.BorderStyle.Tcbs_none, BorderSize.one, 1, Color.White);
        Border r = new Border(Novacode.BorderStyle.Tcbs_none, BorderSize.one, 1, Color.White);

        foreach (Cell c in row.Cells)
        {
            c.SetBorder(TableCellBorderType.Top, t);
            c.SetBorder(TableCellBorderType.Left, l);
            c.SetBorder(TableCellBorderType.Right, r);
        }
    }
I call this function on any row whose 3 borders must be removed (colored white)
However, If there could be a better solution please post here.