We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to add column and rows to aspose.words table


1. I have a html file which has tables on it, tables are html calendars,
2. I am getting those table and looping to each cell for me to be able to insert form fields and text to it.

How can add 1 column to rightmost of each calendar table and 1 row at the bottom and insert form fields also to it?

Hi there,

Thanks for sharing the detail. Please note that a table in MS Word is a set of independent rows. Each row has a set
of cells independent on cells of other rows. So there is no logical
“column” in a MS Word’s table. “The 1st column” is something like “a set
of the 1st cells of each row in a table”.

For example, it’s possible to have a table where the 1st row consists
of two cells: 2cm and 1cm and the 2nd row consists of different two
cells: 1cm and 2cm of width.

However, you can work with columns using the approach shared at following documentation link.

Please use the following code example to insert row at the end of table and insert a text input form field. Please let us know if you have any more queries.

<!–[if gte mso 9]>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}


var doc = new Document(MyDir + "in.docx");

DocumentBuilder builder = new DocumentBuilder(doc);

//Get the first table in the document

Table table = doc.FirstSection.Body.Tables[0];

//insert empty row at the end of table

Row lastrow = (Row)table.LastRow.Clone(true);


foreach (Cell cell in lastrow.Cells)






builder.InsertTextInput("TextInput", TextFormFieldType.Regular, "", "Hello", 0);


doc.Save(MyDir + "Out.docx");