Incorrect width of table cells

I use following code to get width of cells from a table in my document. The table has one row and 2 cells. Opening the document in MS Word, I can see the Cell[0] width is bigger than Cell[1]. However, my code shows Cell[0].Width = 400.4 and Cell[1].Width = 78.4. That means Cell[1] width is bigger than Cell[0] in Aspose. How can I get the width same with MS Word in Aspose? I attach my document.

Thanks for your helps.

Document doc = new Document("doc1.docx");
Table table = (Table) doc.GetChild(NodeType.Table, 0, true);

System.Console.WriteLine("Cell[0].Width = " + table.Rows[0].Cells[0].CellFormat.Width);
System.Console.WriteLine("Cell[1].Width = " + table.Rows[0].Cells[1].CellFormat.Width);

Hi
Thanks for your request. Most likely this occurs because table grid of this table is not in actual state. Aspose.Words does not update table grid, just read it as is from the document. You can try updating table layout to get actual width of cells:

Document doc = new Document(@"Test001\doc1.docx");
doc.UpdateTableLayout();
Table table = (Table) doc.GetChild(NodeType.Table, 0, true);
System.Console.WriteLine("Cell[0].Width = " + table.Rows[0].Cells[0].CellFormat.Width);
System.Console.WriteLine("Cell[1].Width = " + table.Rows[0].Cells[1].CellFormat.Width);

Hope this helps.
Best regards,

Thanks. It works for me.