Space between header and table

When a table spans to multiple pages, its header gets repeated. The problem is the table header attached to header of the page. There is no space between the header of the page and table header due to which the top border of the page is not appeared properly. I want to have some padding between table top border and header of the document. How can I achieve it.
I have attached a sample document for your reference.
I tried with the following code. But of no use.

table.firstrow.rowformat.toppadding = 6.0;

Please reply ASAP
Chirag Rajput


Thanks for your request. I think, in your case you can just decrease header distance (distance between top of page and header). In this case header will be moved up and there will be small gap between header and tables. You can achieve this by modifying your template or using the following code:

Document doc = new Document(@"Test001\testing.doc");
// Loop through all sections and decrease header distance.
foreach(Section section in doc.Sections)
section.PageSetup.HeaderDistance = 15;

Hope this helps.
Best regards.