I'm using the "Limit allowed HTML tags" filter in my text format and put this to the allowed tags: <th style>
Anyway my table styling <th style="width: 60%;">
added in Ckeditor is filtered out. What have I missed?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityThe "Limit allowed HTML tags" filter triggers Drupal's XSS filter, which strips all style attributes. So you cannot use style
attributes and "Limit allowed HTML tags" at the same time.
There are stalled efforts to eventually address this by modifying how Drupal performs XSS filtering.
style="width: 60%;"
is an html attribute, not a tag.
I put this to the allowed tags:
<th style>
Therefore, you need to remove the style
part and just put table header tag <th>
in the allowed tags.
style
, which is always removed by the "Limit allowed html tags" filter, because you can use it for XSS attacks.