I am unable to dynamically render table rows as a row using a child component.
Parent:
<template>
<template if:true={data.results}>
<table>
<tr>
<th>ID</th>
</tr>
<template for:each={data.results} for:item="result">
<c-child-table-row key={result.id} rowResult={result}></c-child-table-row>
</template>
</table>
</template>
</template>
Child:
<template>
<tr key={rowResult.id}>
<td>
{rowResult.id}
</td>
</tr>
</template>
The rows rendered are not rendered as a table even though inspecting the DOM shows they have the appropriate classes.
:host { display: table-row }. If that works (a variant on this theme did for us), I'll convert this to an answer.:host { display: xxx }. TBH, we usedtable-header-groupfor what we were doing (the child was a header row). You could try various other display options iftable-rowisn't working for you. Alternatively, move the<tr>into the parent and have the child simply render a sequence oftdelements? Or as Ronnie said, simply remove the<tr>from the child template since the outer-most<template>is what is being treated as a row via the CSS.