1

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

Redactor table

Upon saving the Redactor field, the table content is converted into text and put inside

tags (see image below).

Rendered Redactor table

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?

1 Answer 1

1

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.