PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 9:25 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Aug 31, 2017 1:24 pm 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
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 9340 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 31, 2017 2:26 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 01, 2017 12:40 pm 
Offline

Joined: Tue Aug 15, 2017 11:27 am
Posts: 29
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 9330 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 01, 2017 1:04 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
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

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 138 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group