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

Merge cells in table with differents border style
https://forum.pdfsharp.net/viewtopic.php?f=2&t=3654
Page 1 of 1

Author:  pistoletov [ Thu Aug 31, 2017 1:24 pm ]
Post subject:  Merge cells in table with differents border style

Hi!
i have a problem with this table.
This my code
Code:
            row = table.AddRow();
            row.Cells[0].MergeDown = 3;
            row = table.AddRow();
            row.Cells[1].Borders.Left.Visible = false;
            row = table.AddRow();
            row.Cells[1].Borders.Left.Visible = false;
            row = table.AddRow();
            row.Cells[1].Borders.Left.Visible = false;

if i put string row.Cells[1].Borders.Left.Visible = false; after MergeDown all left borders cell[1] disappeared. But i need to disapear borders in cell[1] in 1,2,3 rows. I try many variants but all of them not resolve my problem. I attach picture of needed table view.
The table have 1 column (merged down 4 rows) and second column with different style cell border.

Attachments:
Table.jpg
Table.jpg [ 50.46 KiB | Viewed 9427 times ]

Author:  Thomas Hoevel [ Thu Aug 31, 2017 2:26 pm ]
Post subject:  Re: Merge cells in table with differents border style

Hi!

Make sure Cell[0] in the first row does not have a right border.
I think the borders you see are the union of the right border of the left cell and the left border of the right cell.

Author:  pistoletov [ Fri Sep 01, 2017 12:40 pm ]
Post subject:  Re: Merge cells in table with differents border style

Thank you for reply
Code:
            table = field58.AddTable();
            table.Borders.Width = "1.5pt";
            table.Borders.Color = TableBorder;
            column = table.AddColumn(Unit.FromPoint(197));
            column = table.AddColumn(Unit.FromPoint(73));
            row = table.AddRow();
           
            row.Cells[1].Borders.Left.Visible = true;
            row.Cells[0].MergeDown = 3;
           //red string
           row.Cells[0].Borders.Right.Visible = false;
            row = table.AddRow();
            //green place
            row = table.AddRow();         
            row = table.AddRow();

in this variant border disapear (on attached picture)
if i put the red string after green place the all borders appear. I suppouse that borders between cells is not combine border from left cells[0] and right cells[1]. Unfortunatelly all my experiments was all border appear or disapear but never with some borders. May be this is the bug? The MergeDown touches not only content of merge cells but i other attributes. Migradoc version - 1.32.3885.0
May be the resolve problem is do no merge cells and put content in the text frame above this table?

Attachments:
test2.png
test2.png [ 1.68 KiB | Viewed 9417 times ]

Author:  TH-Soft [ Fri Sep 01, 2017 1:04 pm ]
Post subject:  Re: Merge cells in table with differents border style

Hi!

Another option: nested tables.

Make a 2x1 table (2 columns) and place a 1x4 table into the right cell.

See also:
https://stackoverflow.com/a/36304148/1015447

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