Issue #1939💬 AnsweredOpened April 2, 2019by minuwan0 reactions

Table and Div with Grapesjs

快速解答by artf

I need to place a "Div with some texts" inside a table's "tbody". You can't because it's against HTML5. Inside tbody you can only place tr

Read full answer below ↓

Question

I need to place a "Div with some texts" inside a table's "tbody". I managed to trag and drop it. But when I saved it and load it again the div goes back to before the table tag. I belive this is happens in the blocks/compents coded to not allow any other elemenet to go inside. Is there any way to overcome this ?

PS: I'm using that Div to generate a loop in the final generated html code.

// Before saved
<table>
    <thead>
        <tr>
            <th>Column 1</th>
            <th>Column 2</th>
        </tr>
    </thead>
    <tbody>
        <div>loop_start</div> <-------- THESE (Orignal position)
        <tr>
            <td>Column 1</td>
            <td>Column 2</td>
        </tr>
        <div>loop_end</div> <-------- THESE (Orignal position)
    </tbody>
</table>
// After saved
<div>loop_start</div> <-------- MOVED TO HERE
<div>loop_end</div>   <-------- MOVED TO HERE
<table>
    <thead>
        <tr>
            <th>Column 1</th>
            <th>Column 2</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Column 1</td>
            <td>Column 2</td>
        </tr>
    </tbody>
</table>

Answers (2)

artfApril 3, 2019

I need to place a "Div with some texts" inside a table's "tbody".

You can't because it's against HTML5. Inside tbody you can only place tr

lock[bot]April 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.