2
votes

I have a document with a table. I need to be able to add columns to a specific row, while maintaining the original table width.

Essentially I need to SPLIT table cells. How can I do this using open xml for a word document? I tried

                    var tc = new TableCell();
                    tc.Append(new Paragraph(new Run(new Text("Hi"))));
                    row.Append(tc);

I tried just adding more cells, however it acts as new column and increases the size of the table.

1
I was hoping for an answer that doesn't involve "lel, use a table that has them split already".j riv

1 Answers

0
votes

First of all create a table in microsoft word and split cell there. Now open your word document in OpenXML SDK Development Tool which can be downloaded from here. If you look at the relevent cell in OpenXML, you will find the answer to your problem. Just copy code from OpenXML and make any necessory changes according to your requirements.