CSS not applied to table when editing

Created on 25 June 2023, over 1 year ago
Updated 7 July 2023, over 1 year ago

I am using Drupal 9.5.9. and CKeditor4 1.0.2 I have an HTML table that is styled via CSS. The source code is embedded in a text area. When editing, no CSS styles are applied to it so I just get a black box. How can I make sure css styles pass through to it when in edit mode please?

I am currently Googling for potential fixes and this sounds like it might solve my problem but I don't know how to apply it!

CKEDITOR.config.allowedContent = true;

Thanks for your time and thoughts.

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

🇺🇸United States guymandude

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @guymandude
  • 🇺🇸United States guymandude

    For anyone else struggling with this.
    After trying various potential fixes using the CKEDITOR.config.allowedContent = true; method to no avail (i don't know the correct file to edit), I edited my subtheme info.yml file and added my own custom stylesheet like so:

    ckeditor_stylesheets:
    - css/style.css
    - css/custom.css

    Edit mode looks like view mode now.

  • 🇮🇳India vaibhav_arora

    I tried to replicate using the above versions and below I have attached the steps to reproduce:
    1. Go to /admin/config/content/formats
    2. Edit Full HTML and select the editor as CKEditor.
    3. Create a HTML table and add required CSS and click source again and you will see your styling in the body itself.
    For reference, I have attached screenshot when applying styles and working fine on my end.

Production build 0.71.5 2024