Is there any constraint that's preventing <thead>, <tbody>, <tr> and so on to be slotted in shadow DOM?
Given the following example:
<script>
class Table extends HTMLElement {
constructor() {
super();
this.attachShadow({mode: 'open'}).innerHTML = `
<table>
<thead>
<slot name="header"></slot>
</thead>
<tbody>
<slot name="row"></slot>
</tbody>
</table>
`;
}
}
window.customElements.define('data-table', Table);
</script>
<data-table>
<tr slot="header">
<th>header1</th>
</tr>
<tr slot="row">
<td>cell1</tr>
</tr>
</data-table>
renders into the following structure:

The workaround would be to use templates and insert template content with JS in slotchange event handler, but I would like to avoid that since the cloned content would end up in shadow DOM and it will not be possible to override styles from outside of the custom element.