使用C#在单词表中关闭自动调整

问题描述

如何使用C#在单词表中关闭自动拟合功能?我上课

DocumentFormat.OpenXml.Wordprocessing.Table.

我的意思是这个选项:

enter image description here

我要取消选中它。

解决方法

TableProperties tp = new TableProperties(
  new TableLayout { Type = TableLayoutValues.Fixed }
);
Table t = new Table(tp);

在添加表格样式等内容后,请确保将tablelayout属性添加到tableproperties中。