Akhil
Akhil

Reputation: 2030

Table Row Border - Migradoc

I am creating one table with migradoc. I need to give row border but not in each cells. So i need only outer border.

Code:

        Row row = source.AddRow();
        row.Borders.Width = 0.2;
        row.Borders.Color = Colors.Black;

Here is my existing code. With this i got border for all cells. Please help to avoid border in each cells

Upvotes: 1

Views: 4274

Answers (2)

Aneeq Azam Khan
Aneeq Azam Khan

Reputation: 1032

you can set width for specific border like

yourrow.yourcell[0].Borders.Left.Width = 1.5;

following above example you can set width for required border separately but if you want to set width for all four border at once you use table.SetEdge method like
// Set the borders of the specified cell range

 table.SetEdge(5, this.table.Rows.Count - 4, 1, 4, Edge.Box, BorderStyle.Single, 0.75);

for more information have a look on MigraDoc example

Upvotes: 2

You can set each border (left, right, top, bottom) for each cell independently.

You can use the SetEdge method of the Table class to make things easier.

See also (search for SetEdge):
http://pdfsharp.net/wiki/HelloMigraDoc-sample.ashx

Upvotes: 1

Related Questions