- Issue created by @sumit_saini
- 🇮🇳India SandeepSingh199
This is the issue of ckeditor5 alignment tool. This bug CF in drupal11 too. for quick fix you can write inline style in edit mode(html) of table
<table style="margin:0 auto;">
.
I have checked with Claro & Gin, table took by default 100% width. Olivero theme is working fine but the issue with table alignment.
I am looking into it. I will add a patch if found anything. - Status changed to Postponed: needs info
11 months ago 2:52pm 19 December 2023 - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Thanks for linking the related issue! And especially thanks for creating an upstream issue! 👏
Can you also reproduce this at https://ckeditor.com/docs/ckeditor5/latest/examples/builds/classic-edito...?
- 🇩🇪Germany carp-enter
I have the same problem with Drupal 10.2.2 and PHP 8.2.15.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
- 🇮🇳India sumit_saini
On this link https://ckeditor.com/docs/ckeditor5/latest/examples/builds/classic-edito..., table properties plugin and source edit pluign is not available. So let me try to explain/reproduce this on https://ckeditor.com/docs/ckeditor5/41.1.0/examples/builds-custom/full-f....
There, I created 3 one cell tables with left(L), center(C) and right(R) alignment respectively as shown below
The html will render as below when viewed(generated html and its view can be checked here - https://jsfiddle.net/Lsepjmut ).
See that L and R tables are rendered as expected but the table C is left aligned instead of center aligned.
Because ckeditor5 only handled its look inside editor and did not account for the browser behaviour, this is a problem for
- pages rendered with drupal theme(easy fix is to attach extra css fix to handle it with theme)
- API responses for headless implementation (not possible to add a css fix for this case by drupal)
One solution to fix for both above cases, is to implement a text processor(filter) to add the necessary style properties but this sounds like a overhead already.In the meantime, we can use the workaround suggested in #3 but this is not good UX for a non-technical contributor. So, it is better if this is fixed upstream by ckeditor5 (which unfortunately has been disagreed here https://github.com/ckeditor/ckeditor5/issues/15535#issuecomment-1864029206 ).
- 🇮🇳India nitesh624 Ranchi, India
I see upstream issue is closed. So is that something missing from Drupal side or we need to see any workaround plugin