If I add a row to a table with an existing th row
y=document.createElement('tr');
z=document.createElement('td');
z.append(document.createTextNode('abc'));
y.append(z);
x.append(y);
console.log(x.innerHTML);
<table id="x">
<tr><th>xyz</th></tr>
</table>
I get
<tbody><tr><th>xyz</th></tr></tbody><tr><td>abc</td></tr>
from innerHTML, but this has added a tbody tag.
I wanted
<tr><th>xyz</th></tr><tr><td>abc</td></tr>