MigraDoc - imbricated / nested tables?

旧巷老猫 提交于 2019-11-29 15:15:57

The Invoice sample uses merging:
http://www.pdfsharp.net/wiki/Invoice-sample.ashx

The keywords are MergeRight and MergeDown. Use MergeRight=1 to get a cell that spans two columns.

I think merging is the best approach if it does not get too complicated.

You can add TextFrame to a Cell and add a Table to a TextFrame to achieve nested tables. However you will have to deal with the row height as the table cell will not grow automatically when the contents of the TextFrame grow.

There is a trick to add a Table to a Cell or Paragraph in a cell using the generic Add method. Code hack that adds a table to a table cell:

parentCell.Elements.Add(currentTable);

This is an undocumented feature. Merging is the recommended approach.

Cells do not break to the next page, so adding tables to cells will work for small nested tables only.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!