Skip to content

Multiple MergeDown error #2

Description

@pahanbi4
		using (var doc = DocX.Create(@"z:\blah\blah\blah\doc.docx", DocumentType.Document))
		{
			var table = doc.AddTable(5);

			for (int k = 0; k < 10; k++)
			{

				for (int i = 0; i < 5; i++)
				{
					var row = table.AddRow();
					row.SetBorders(Units.HalfPt, BorderValue.Single);

					for (int j = 0; j < 5; j++)
					{
						row.Cells[j].Paragraphs[0].Append($"Cell {(j + 1)}");
					}
				}

				var rows = table.Rows.ToList();

				var c = k * 5;
				var firstRow = rows[c];
				firstRow.Cells[0].MergeRight = 3;
				firstRow.Cells[1].AddParagraph().Append("Should not display.");

				var secondRow = rows[c + 1];
				secondRow.Cells[1].MergeDown = 3;

				var thirdRow = rows[c + 2];
				thirdRow.Cells[1].AddParagraph().Append("Should not display.");
			}

			doc.Save();
			doc.Close();
		}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions