How to put a border around whole table simply


#1

I defined a table with columns and lines dynamically .I would like to apply a border around this table while avoiding to define the border of each cell of each line.

Have any idea?


#2

If you want to set border around the table, without setting inner horizontal and vertical borders then just define these borders before building the table. For example

builder.RowFormat.Borders[BorderType.Top].LineStyle = LineStyle.Single;

builder.RowFormat.Borders[BorderType.Bottom].LineStyle = LineStyle.Single;

builder.RowFormat.Borders[BorderType.Left].LineStyle = LineStyle.Single;

builder.RowFormat.Borders[BorderType.Right].LineStyle = LineStyle.Single;

Table table = builder.StartTable();

...

Hope this helps,