如何通过openxml确定word中的列宽

时间:2016-01-10 04:08:03

标签: openxml

我需要创建一个word文件并通过openxml在其中插入一个网格。 到目前为止,我知道如下所示创建网格会将表格宽度设置为适合窗口

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);

但是如何将行划分为一些共享相同宽度的列。因为我不知道桌子的宽度,所以我无法计算列的宽度。 并且不同行中的列号可能不同。

请帮助我,谢谢

0 个答案:

没有答案