Skip to content

Table captions are broken in print #18903

@eliandoran

Description

@eliandoran

📝 Provide detailed reproduction steps (if any)

  1. Go to https://ckeditor.com/ckeditor-5/demo/feature-rich/.
  2. Insert a table.
  3. Add a caption to the table (a few words at least).
  4. Observe the position and size of the table.
  5. Enable print emulation in Chrome

✔️ Expected result

The table caption should render properly, like in the desktop/display version.

Image

❌ Actual result

The figcaption is broken, being displayed each letter on a separate row.

Image

❓ Possible solution

The issue appears not to be from within the figcaption itself, but the parent figure. For the display: table-caption of the figcaption to work, the parent figure needs to be display: block, but there is specific a override for printing:

@media print {
    .ck-content figure.table:not(.layout-table):has(>table) {
        display: block;
    }
}

The solution would probably be to either remove the rule to let the parent figure be a table or change the display of the figcaption (however this would break the alignment, being displayed at the bottom instead of the top of the table).

📃 Other details

  • Browser: Edge Version 138.0.3351.95 (Official build) (arm64)
  • OS: Windows 11
  • First affected CKEditor version: 46.0.0
  • Installed CKEditor plugins: Happens in vanilla as well.

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Metadata

Metadata

Assignees

No one assigned

    Labels

    package:tablerelease:blockerThis issue blocks the upcoming release (is critical).resolution:resolvedThis issue was already resolved (e.g. by another ticket).type:bugThis issue reports a buggy (incorrect) behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions