Hi Hardik,
Thank you for contacting Syncfusion support.
From the given details, we have found that your requirement is to remove the particular column from the table except first row in the table and also wants to adjust the cells in the remining rows automatically to the first row. When we remove the particular column from the table except first row, the Microsoft Word application also not automatically readjust the cells based on the first row. So, we did the same in our library. If you want to adjust the cells based on the first row, you can manually resize the cell’s width in remining rows as like below.
|
for (int rowIndex = 1; rowIndex < table.Rows.Count; rowIndex++) { float width = table.Rows[rowIndex].Cells[indexToRemove].Width; table.Rows[rowIndex].Cells.RemoveAt(indexToRemove); //Add the removed cell width to adjacent cell table.Rows[rowIndex].Cells[indexToRemove].Width += width; } table.TableFormat.IsAutoResized = true; |
Based on the above, we have prepared the sample and it can be downloaded from the below link.
https://www.syncfusion.com/downloads/support/forum/157637/ze/ResizeTable-52492223If we misunderstood any of your requirement, then kindly provide us sample or modified sample of above along with input template, and screenshot/output Word document of the expected result which will helpful to provide you the appropriate solution at the earliest
Please let us know if you have any other questions.
Regards,
Manikandan Ravichandran