Project

General

Profile

Actions

Bug #105644

open

CKEditor 5: Table handling issues

Added by Florian Seirer about 23 hours ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2024-11-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I noticed some weird behaviour with tables in CKEditor 5:

1) Changing a row with TDs to THs:
Insert his into a RTE field, then try to make the 3rd row a TH using the row (Table options > row > header):

<figure class="table">
    <table>
        <thead>
            <tr>
                <th>
                    TH
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>
                    TD
                </td>
            </tr>
            <tr>
                <td>
                    TH
                </td>
            </tr>
            <tr>
                <td>
                    TD
                </td>
            </tr>
        </tbody>
    </table>
</figure>

This results in the second row also becoming a TH. Reverse that with the header toggle, and the third row becomes a TD again, while the second row remains a TH.
All those rows are moved to <thead>.

Changing the TD to a TH manually in the source view also moves the row into <thead>.

2) Changing tables that were last saved under CKEditor 4 (TYPO3 11):

We have some long tables which have THs in the first row and also a few rows further down for better readability (similar to the first example). When you open the content element the table is already "rebuild", because the RTE moved all the TH rows to the top (inside <thead>), completely changing the look and meaning of the table.

Is this how tables should be used if you "adamantly stick to HTML standards", or does CKEditor go too far with this?

My RTE config for tables:

editor:
  config:
    table:
      defaultHeadings: { rows: 1 }
      contentToolbar:
        - tableColumn
        - tableRow
        - mergeTableCells
        - tableProperties
        - tableCellProperties
        - toggleTableCaption


Files

2024-11-20 08_39_28-Window.png (6.76 KB) 2024-11-20 08_39_28-Window.png Florian Seirer, 2024-11-20 07:41

No data to display

Actions

Also available in: Atom PDF