#Bug in table with loop

6 messages · Page 1 of 1 (latest)

fickle snow
#
<p>before</p>
<table>
    <tr>
        <th>head row</th>
    </tr>
    {
        [1, 2, 3].map(() => (
            <tr>
                <td>row</td>
            </tr>
        ))
    }
</table>
<p>after</p>

renders as

before
after
head row
row
row
row

Am i doing something wrong? If I remove the head row or wrap the table within a div it works correctly

#

In the source code the paragraph ends up within the table here:

<p data-astro-cid-dmgfdf2n>before</p>
<table data-astro-cid-dmgfdf2n>
    <tr data-astro-cid-dmgfdf2n>
        <td data-astro-cid-dmgfdf2n>head row</td>
    </tr>
    <tr data-astro-cid-dmgfdf2n>
        <td data-astro-cid-dmgfdf2n>row</td>
    </tr>
    <tr data-astro-cid-dmgfdf2n>
        <td data-astro-cid-dmgfdf2n>row</td>
    </tr>
    <tr data-astro-cid-dmgfdf2n>
        <td data-astro-cid-dmgfdf2n>row</td>
    </tr>
    <p data-astro-cid-dmgfdf2n>after</p>
</table>
midnight flame
#

Which version of astro are you using? Moreover, can you share the configuration that you use?

rigid dune
midnight flame
#

It also seems to work for me! Something seems amiss

rigid dune
#

yes mayb ...