Issue #1121💬 AnsweredOpened May 18, 2018by alimajed930 reactions

<Tbody> inside <Table>

Quick answerby artf

I think this happens because when you add the HtmlCode is parsed by the browser, but outside of the table scope and therefore it strips your tags. Try to skip the parser by passing a component object:

Read full answer below ↓

Question

Hi @artf , I created a new component with tagName = 'table'. When selected and one option of its toolbar I also created is clicked, a new modal opens, and when the user submits, some content should be added to the block. I am using editor.getSelected().get('components').add(HtmlCode), where HTML code always starts with <tbody><tr><td>. My issue is that those tags are being omitted. So the final result is <table>[Rest of the HTML code] instead of <table><tbody><tr><td>[Rest of the HTML code]. I think it is because tbody is only draggable inside a table? But as I mentioned, the component is alr...

Answers (3)

artfMay 23, 2018

I think this happens because when you add the HtmlCode is parsed by the browser, but outside of the table scope and therefore it strips your tags. Try to skip the parser by passing a component object:

no-response[bot]June 2, 2018

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we ne...

lock[bot]September 17, 2019

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 →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.