我在.docx文件中创建了一个表,并更改了对齐,字体等。 现在我通过C#生成新行,但它们不像上面的单元格那样具有相同的对齐,字体等。
如何为行设置类似.css文件的内容? 以下显示我的代码如何在表中添加一行:
TableRow tr = new TableRow();
TableCell positionCell = new TableCell();
positionCell.Append(new Paragraph(new Run(new Text(i.ToString()))));
TableCell bezeichnungCell = new TableCell();
descCell.Append(new Paragraph(new Run(new Text("Description"))));
tr.Append(positionCell);
tr.Append(descCell);
t.Append(tr);
此外,我无法使用xaml之类的positionCell.Alignment = Alignment.Center
之类的东西。