2
votes

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

2 Answers

0
votes

I believe inline styles are removed by default for security reasons. But, there has been a lot of discussion about this issue on Drupal.org over the past few years. If you're looking for a workaround and accept the risk, here are two approaches I have found:

Fair warning: I have not personally implemented either of these.

0
votes

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.