| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/ |
|
| Rowspan and colspan not working in 0th cell. https://forum.pdfsharp.net/viewtopic.php?f=2&t=3357 |
Page 1 of 1 |
| Author: | chints667 [ Wed May 11, 2016 9:11 am ] |
| Post subject: | Rowspan and colspan not working in 0th cell. |
I want merge cell in migradoc table. When i try to merge cell[0] with rowspan and colspan it merged with colspan only. Rowspan is not working. Same thing works fine if cell number is not 0. |
|
| Author: | Thomas Hoevel [ Wed May 11, 2016 9:57 am ] |
| Post subject: | Re: Rowspan and colspan not working in 0th cell. |
Please provide complete source code. See also: viewtopic.php?f=2&t=832 |
|
| Author: | chints667 [ Fri May 13, 2016 8:49 am ] |
| Post subject: | Re: Rowspan and colspan not working in 0th cell. |
i just want To Merge Cell in Table . i getting stuck when i am trying merge cell at (0,0) to merge down and merge right it gives some unproper merge. please check attached source file for reference. Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.Security; using MigraDoc.DocumentObjectModel; using MigraDoc.DocumentObjectModel.Tables; using MigraDoc.Rendering; using System.Drawing.Imaging; using System.Diagnostics; using System.Reflection; namespace MigraDocTableQuery { class Program { static void Main(string[] args) { Document doc = new Document(); Section sec = doc.AddSection(); Paragraph para = sec.AddParagraph(); Table table = sec.AddTable(); table.Style = "Table"; table.Borders.Width = 0.75; table.AddColumn(); table.AddColumn(); table.AddColumn(); table.AddColumn(); table.AddColumn(); table.AddRow(); table.AddRow(); table.AddRow(); table.AddRow(); table.AddRow(); // case 1: // here table have total 5 columns and 5 rows // I want merge from from (0, 0) to merge right and merge down table.Rows[0].Cells[0].MergeDown = 4; table.Rows[0].Cells[0].MergeRight = 4; // case 2: // if i merge from (0, 1) it works properly table.Rows[0].Cells[1].MergeDown = 3; table.Rows[0].Cells[1].MergeRight = 3; } } } thanks in advance |
|
| Author: | TH-Soft [ Fri May 13, 2016 8:25 pm ] |
| Post subject: | Re: Rowspan and colspan not working in 0th cell. |
What's the point in creating five rows and five columns when the first cell spans all five rows and all five columns and the table effectively has a single cell only? Do you get an error at runtime? Do you get a PDF file? If so, please show it. The style "Table" is undefined. You do not set the column width for the columns. Which version of PDFsharp/MigraDoc? See also: viewtopic.php?f=2&t=832 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|