How to put a border around whole table simply


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?


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,