我使用Migradoc以生成表并填充几列一些动态数据,我已经定义列的宽度,同时限定表结构原样列文本满溢出来柱的宽度
Table table = new Table();
Column column = table.AddColumn(Unit.FromCentimeter(6));
column.Format.Alignment = ParagraphAlignment.Left;
table.AddColumn(Unit.FromCentimeter(6));
table.AddColumn(Unit.FromCentimeter(8));
现在第三列是有数据(acs800-07-1234a-5+asdf+asdf+qwer+w[email protected]34gh+23rg-4s544
),但它溢出列并被截断到页面的右侧。它会自动包装但不正确,某些文字在第二行中丢失。见图片:
任何指针来解决这个问题,在文本换行,将不胜感激。
更新 -(摘录示出表的数据是如何被添加)
Row row = table.AddRow();
Cell cell = row.Cells[0];
cell.AddParagraph("ACS880-104");
cell = row.Cells[1];
cell.AddParagraph("R1 – R10");
cell = row.Cells[2];
cell.AddParagraph("acs800-07-1234a-5+asdf+asdf+qwer+wer[email protected]34gh+23rg-4s544");
如何将文本添加到表格中? “段落”? 'FormattedText'? 'TextFrame'? –
这是一个真正的单词类型代码,还是在使用真实数据时会有空格和连字符? –
@MongZhu我正在使用段落添加文本 - 也更新了代码片段 – Ashutosh