SharpDocx icon indicating copy to clipboard operation
SharpDocx copied to clipboard

Ambiguous cell mapping encountered. Possible missing paragraph element. <p> elements are required before every </tc>

Open apetrut opened this issue 3 years ago • 1 comments

Hi.

I am using this template:

<%foreach (var item in Model.Items){%>

// a table with rows and columns. Some rows contain nested tables as well.

<%}%>

which works fine if the data exists in the model. However, if the data doesn't exist in the mode, it would create an empty table and show the error in the title when opening using Word.

I tried adding spaces or line breaks but with no luck.

Can you help?

Thanks.

apetrut avatar May 12 '22 12:05 apetrut

I have checked each field in the template and I found out that I had to manually add a new line at the end of each field (I basically pressed enter from the keyboard). This was also needed for nested tables.

apetrut avatar May 12 '22 13:05 apetrut