Fixed the problem with setting the column width of the whole table.master
| if (grid == null) | if (grid == null) | ||||
| { | { | ||||
| XElement tblPr = GetOrCreate_tblPr(); | XElement tblPr = GetOrCreate_tblPr(); | ||||
| tblPr.AddAfterSelf(XName.Get("tblGrid", DocX.w.NamespaceName)); | |||||
| tblPr.AddAfterSelf(new XElement(XName.Get("tblGrid", DocX.w.NamespaceName))); | |||||
| grid = Xml.Element(XName.Get("tblGrid", DocX.w.NamespaceName)); | grid = Xml.Element(XName.Get("tblGrid", DocX.w.NamespaceName)); | ||||
| } | } | ||||
| Assert.AreEqual(bookmarkNames[i], result[i]); | Assert.AreEqual(bookmarkNames[i], result[i]); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | |||||
| [TestMethod] | |||||
| public void CreateTable_WhenCalledSetColumnWidth_ReturnsExpected() | |||||
| { | |||||
| using (var document = DocX.Create("Set column width.docx")) | |||||
| { | |||||
| var table = document.InsertTable(1, 2); | |||||
| table.SetColumnWidth(0, 1000); | |||||
| table.SetColumnWidth(1, 2000); | |||||
| Assert.AreEqual(1000, table.GetColumnWidth(0)); | |||||
| Assert.AreEqual(2000, table.GetColumnWidth(1)); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | } | ||||