我想通过openxml创建一个word文件并在其中插入一个表格。现在我不知道如何设置网格的宽度以适应 word 文件。请帮我。谢谢
表格宽度可以通过第二行代码设置。
其余的只是为了展示如何将属性附加到表中
TableProperties tblProps = new TableProperties();
tableWidth = new TableWidth() { Width = "5000", Type =TableWidthUnitValues.Pct };
TableStyle tableStyle = new TableStyle() { Val = "TableGrid" };
tblProps.Append(tableStyle, tableWidth);
table.Append(tblProps);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1332 次 |
| 最近记录: |