<p>I finally found the solution:</p>
<p>I was running HTML Purifier on my Redactor Fields and had to allow the table tags in my config/htmlpurifier/Default.json like this:</p>
<pre><code>  &quot;HTML.Allowed&quot;: &quot;img[src], a[href][target], p, ul, ol, li, h2, h3, h4, strong, br, table, td, tr&quot;
</code></pre>

CC BY-SA 4.0
2022-08-23T12:11:41.050Z
2022-08-23T12:11:41.050Z
Droemmelbert
<p>I added the table plugin to my Redactor field. In the redactor field I can now include a table (see image below).</p>
<p><a href="https://i.sstatic.net/VRHCA.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/VRHCA.png" alt="Redactor table" /></a></p>
<p>Upon saving the Redactor field, the table content is converted into text and put inside <p> tags (see image below).</p>
<p><a href="https://i.sstatic.net/b4LRo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/b4LRo.png" alt="Rendered Redactor table" /></a></p>
<p>This is what my settings for the Redactor field look like:</p>
<pre><code>{
  &quot;buttons&quot;: [&quot;formatting&quot;, &quot;link&quot;, &quot;ul&quot;, &quot;ol&quot;, &quot;bold&quot;,&quot;html&quot;],
  &quot;formatting&quot;: [&quot;h2&quot;, &quot;h3&quot;, &quot;h4&quot;],
  &quot;linkNewTab&quot;: true,
  &quot;toolbarFixed&quot;: true,
  &quot;pasteBlockTags&quot; : [&quot;h2&quot;, &quot;h3&quot;, &quot;h4&quot;, &quot;p&quot;, &quot;ul&quot;, &quot;ol&quot;, &quot;li&quot;, &quot;br&quot;, &quot;table&quot;, &quot;td&quot;, &quot;tr&quot;],
  &quot;imageResizable&quot; : true,
  &quot;plugins&quot;: [&quot;table&quot;, &quot;alignment&quot;]
}
</code></pre>
<p>How do I make the Redactor field not strip those table tags and render the table correctly?</p>

<craft3><redactor><richtext><table>
Why is my redactor table converted to a text when saving?
# Why is my redactor table converted to a text when saving?

(Asked by: username_0 on 2022-08-23)

I added the table plugin to my Redactor field. In the redactor field I can now include a table (see image below).

Upon saving the Redactor field, the table content is converted into text and put inside  tags (see image below).

This is what my settings for the Redactor field look like:
{
  "buttons": ["formatting", "link", "ul", "ol", "bold","html"],
  "formatting": ["h2", "h3", "h4"],
  "linkNewTab": true,
  "toolbarFixed": true,
  "pasteBlockTags" : ["h2", "h3", "h4", "p", "ul", "ol", "li", "br", "table", "td", "tr"],
  "imageResizable" : true,
  "plugins": ["table", "alignment"]
}

How do I make the Redactor field not strip those table tags and render the table correctly?

**Tags:** craft3, redactor, richtext, table


---

## 1 answers

### Answer by username_0 on 2022-08-23. Score: 1 | Accepted answer

I finally found the solution:
I was running HTML Purifier on my Redactor Fields and had to allow the table tags in my config/htmlpurifier/Default.json like this:
  "HTML.Allowed": "img[src], a[href][target], p, ul, ol, li, h2, h3, h4, strong, br, table, td, tr"


---

