Please check the attached word document. I’m trying to determine the “Main” columns width and I want to be able to change these on the whole table.
I tried using row cells by looping thru each row of the table object but there is no way to determine which cell of each row belong to what column of the table.
In word you can drag the column left side and move it and it will change the cells of rows accordingly.
Thanks for your inquiry. The fact is that by Microsoft Word design, rows in a table in a
Microsoft Word document are completely independent. It means each row can have
any number of cells of any width. So if you imagine first row with one wide
cell and second row with two narrow cells, then looking at this document the
cell in the first row will appear horizontally merged. But it is not a merged
cell; it is just a single wide cell.
Please read about specifying table and cells width from here:
Hope this helps you. Please let us know if you have any more queries.
so is there any way I can achieve what I’m looking for? can I measure the left position of each cell to find out which cells from different rows align?
Thanks for your inquiry. Please use CellFormat.Width property to get or set the width of the cell in points. When the parent table’s Auto Fit option is disabled, then this property specifies the actual width of the cell. but when the parent table’s Auto Fit option is enabled, then this width can be updated by the table layout algorithm according to PreferredWidth of this cell and other factors.
I suggest you please read the following documentation link about cell width calculations.
Please let us know if you have any more queries.