Drupal 8 stripping style attributes from table tags

Viewed 1766

I'm using Full HTML filter, with CKEditor. The following filters are enabled:

  • Align images
  • Caption images
  • Track images uploaded via a Text Editor
  • Collapsible text blocks

Note that Limit allowed HTML tags and correct faulty HTML is NOT enabled.

when I add a style attribute to a table element in Ckeditor using the Source view, specifically "width=75%", it is stripped when the page is rendered. When I edit the page again and go to Source view, the style tag is there.

What is stripping it on render?

2 Answers

Inline style is stripped by default with Basic HTML formatter. Unless you have a specific reason why you don't want to turn on Limit allowed HTML tags I highly recommend that you do because it gives you a lot of control over what tags you and others can use in the wysiwyg. In addition, it allows you to add a "Styles" button with pre-configured styles so you don't have to insert inline CSS code repetitively.

Related