Yeah, I ran into that problem. Some of the tables had the first row as a header and some of them did not have a header but did have the 1st body row a different color and used like a header.
I ended up using the following along with Jong’s poser https://creativepro.com/tackling-tables-through-scripting.php to merge the first body row and it worked great.
table.cells.item(0).merge(table.rows.item(0).cells.item(-1));
But the tables with headers caused the script not to work. I found some code that allowed me to convert body rows to header rows but it wouldn’t work in reverse so I did it the harder way. Only the first 3 pages of the 100 page doc had actual header so I moved them to a new document, ran the script, then merged the documents back together.
table.rows.item(0).rowType = RowTypes.bodyRow;
Actually, it does work but only when I select the table. I get an error when I use it with Jong’s code in that URL to do the entire document.