Support CKEditor 5's table properties and cell properties

Created on 16 April 2025, 6 months ago

Problem/Motivation

Ckeditor5's table and table cell properties are not available through the responsive table plugin. This is an issue that has been fixed in Drupal core (see https://www.drupal.org/project/drupal/issues/3324225 ✨ Support CKEditor 5's table properties and cell properties plugins in Full HTML Fixed ).

Proposed resolution

I propose porting the patch that worked for fixing this in Drupal core to work with this module.

User interface changes

Adds the table properties and table cell properties icons to the ckeditor_responsive_table_custom ckeditor5 plugin.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada classiccut

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

Merge Requests

Comments & Activities

  • Issue created by @classiccut
  • πŸ‡ͺπŸ‡¨Ecuador leoenriquezp

    I tested the solution provided in the merge request, but it didn’t work. Therefore, I’m sharing a patch with my proposed solution.

  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York

    @leoenriquezp I tested the MR, and see the functionality (mostly) working (see below); I can apply table styles and cell styles to a responsive table, and I see them output on the page. What functionality are you not seeing working, and what are the steps you took to see that non-working behavior?

    @classiccut thanks for the MR! I noticed two issues.

    1. border-width is not written if it's value is 1px, resulting in border-color and border-style not applying in that case.
    2. The Width and Height controls don't make sense for responsive tables; having those properties set to fixed dimensions breaks this module's core functionality. The module does rightly strip out width and height, so it's confusing to have the options in CKEditor (it's extra confusing because the Width and Height applies inside the WYSIWYG, but not the final display). Width and Height should be removed as options, for both table and cell properties.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States bronzehedwick New York
  • @leoenriquezp patch on #3 worked for me in my local, although the changes don't seem to persist when I save the node.

    In any case I'm not convinced that this module should provide those options, we are removing some of the core table controls in order to improve accessibility and responsiveness and some of these options are a step back. Specially the width and height controls for cells and tables, the Tabled plugin will automatically apply a special class to cells to display them as narrow or wide depending on the content of the cell already, these controls will conflict with it. Table width is set to auto as well through the plugin, and if it needs more horizontal space controls are provided for navigating the different columns.

    I think that if you need to have border, colors and these other options then it's likely that this module is not the best fit for that specific use case.

    Although, the cell alignment options can be useful for editors I guess, for instance if you have a cell with numbers and you want those aligned to the right. Maybe we can include just this functionality without supporting dimensions, background or border options.

Production build 0.71.5 2024