PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

Underline column headings of a table
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2196
Page 1 of 1

Author:  g2012 [ Mon Oct 29, 2012 10:41 pm ]
Post subject:  Underline column headings of a table

Hi,

I have created a table that has 3 column headings.
I can underline the word of each heading but I would like to extend the underline to the width of each column so that it looks like a solid line from the first column to the last.

Such as below
Col 1 Col 2 Col 3

Currently it displays like this:

Col 1 Col 2 Col 3

This is the code that creates the display above:

Row rowTable1 = table1.AddRow();
rowTable1.Cells[0].AddParagraph("Field No.");
rowTable1.Cells[1].AddParagraph("Field Name");
rowTable1.Cells[2].AddParagraph("Contents");
rowTable1.Format.Font.Underline = Underline.Single;

Thanks,
Gloria

Author:  Thomas Hoevel [ Tue Oct 30, 2012 10:56 am ]
Post subject:  Re: Underline column headings of a table

Hi, Gloria,

You can have frames around cells, rows, columns.

Just a wild guess: maybe you should use a header row with a bottom border instead of underlined text.

Author:  g2012 [ Tue Oct 30, 2012 12:24 pm ]
Post subject:  Re: Underline column headings of a table

Thanks for the quick reply...I will try the Header Row.

Next question, how do you create a Header Row? I have viewed the samples and help files but don't see how to do it.
OK...I figured this out.
In case someone else needs to know, I did it this way...

rowTable1.HeadingFormat = true;
rowTable1.Format.Borders.Bottom = rowBorder;
rowTable1.Cells[0].AddParagraph("Field No.");
rowTable1.Cells[1].AddParagraph("Field Name");
rowTable1.Cells[2].AddParagraph("Contents");

Thanks,

Gloria

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/