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

Free Support Forum - aspose.com

Repeating table header not working

I am trying to set the first row as repeated header. I followed the guide as well as the link below with no success.



I have 2 tables set up in Word. They are not nested. Second table is where I declare my repeated header.



Aspose Words Repeating table header issue

Hi Mark,


Thanks for your inquiry. Please try using the following sample code:

Document doc = new Document(MyDir + @“FacilityInvoice4.docx”);

<o:p> </o:p>

Table tab = (Table)doc.GetChildNodes(NodeType.Table, true)[1];<o:p></o:p>

tab.FirstRow.RowFormat.HeadingFormat = true;<o:p></o:p>

tab.TextWrapping = TextWrapping.None;<o:p></o:p>

<o:p> </o:p>

Row row = (Row)tab.Rows[2].Clone(true);<o:p></o:p>

<o:p> </o:p>

for (int i = 1; i < 50; i++)<o:p></o:p>

tab.InsertAfter((Row)row.Clone(true), tab.FirstRow);<o:p></o:p>

<o:p> </o:p>

doc.Save(MyDir + @“15.12.0.docx”);<o:p></o:p>


Hope, this helps.

Best regards,