I have a table in a word document and in my code I add rows to it dynamically. So basically I have one header row and then I could add 2 rows to it or 1000 depending on what data I get from my database. This all works fine and the table breaks onto the subsequent pages perfectly. The only issue I have is how do I make the header repeat on each page. I know how to do this If I create a table from scratch but not sure how you do this for an already existing table in a word document?
Hi Matthew,
Thanks for your inquiry. You can get reference to Table and set “RowFormat.HeadingFormat” flag for the first row as follows:
Table tab = (Table)doc.GetChildNodes(NodeType.Table, true)[0];
tab.FirstRow.RowFormat.HeadingFormat = true;
I hope, this helps.
Best regards,