Table and Div with Grapesjs
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)
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
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.
Issue #1407
[QUESTIONS] EXTRA TBODY ADDED EVERY TIME I SAVED THE HTML DATA.
Hi @artf, I had an issue when I have tables in the editor and I add new rows then if my table is saved when is loaded again an extra tbody...
Issue #843
[QUESTION] - CssComposer - removes unused classes
hi @artf , I import a html , using import from grapesjs-preset-newsletter, with some css classes inside the <style> tag. After the import,...
Issue #1611
Script tag create JSON error
Hi. I'm creating blocks in Grapesjs and I need to use JS on them for hover effect and more.. Everything works fine for the creation, store,...
Issue #984
Does grapesjs support load and modify previous saved work?
When I download a page, I see different html then I saw in the page. When I put the saved html back to the gjs, I see a some different page...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.