Issue #5857πŸ’¬ AnsweredOpened May 2, 2024by hasan-aa0 reactions

When rendering <tr> tags inside <template> tags, tags are trimmed off and only string content is remained.

Quick answerby GJS Helper

This is indeed a known behavior when dealing with HTML fragments that are not valid in a standalone context, such as <tr> or <td> tags outside of a <table> element. GrapesJS, like many HTML parsers, relies on browser-native DOM parsing mechanisms (e.g., innerHTML on a div or DOMParser). Root Cause The default HTML par...

Read full answer below ↓

Question

GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome v121Reproducible demo link https://jsfiddle.net/L27powtg/30/ (the fix it also there, commented out)Describe the bug How to reproduce the bug?Create a custom GJS component for template tags as explained here: https://github.com/GrapesJS/grapesjs/issues/244#issuecomment-324449748Add a template component that has a table row as a child. eg: check the result of editor.toHTML(). What is the expected behavior? The result of toHTML should not trim of the tr, td tags. What is the current behavior? re...

Answers (1)

GJS Helperβ€’ May 17, 2026

This is indeed a known behavior when dealing with HTML fragments that are not valid in a standalone context, such as <tr> or <td> tags outside of a <table> element. GrapesJS, like many HTML parsers, relies on browser-native DOM parsing mechanisms (e.g., innerHTML on a div or DOMParser). Root Cause...

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.