Skip to content

bug: Table pagination issues: missing repeated headers + cell content bleeding outside table (rowspan/over-tall content) #1586

@defurl

Description

@defurl

Type

  • Bug

Description

We’re seeing table pagination/layout issues when a table continues across pages:

  1. Header rows do not repeat on continuation pages (even when the source table clearly has a header row).
  2. Some table cell content visually “bleeds” outside the table/fragment into the page safe zone (top/bottom), especially with merged cells (rowspan) or tall content.

This is not a request for CSS clipping; we need correct layout/fragment rendering so content stays within the correct page/table fragment.

Current Behavior

  • When a table continues onto the next page, header rows are not repeated.
  • In some cases, a cell renders beyond the visible bounds of the table fragment/page content area (content appears above/below the table, into margins/safe zone).
  • Pushing a row to the next page can leave large unused whitespace on the previous page.

Expected Behavior

  • If the table has header rows, continuation fragments should render those header rows at the top of each subsequent page/fragment.
  • Table content should never render outside the table fragment/page content bounds. (It’s fine to split content across fragments/pages, but not to draw it outside the page/table.)
  • Pagination should avoid excessive whitespace: if a row can’t fit, it should move cleanly to the next page; if it must split, splitting should be stable and make progress.

Steps to Reproduce

  1. Open a DOCX (or document) that contains:
    • A table with a header row (Word-style header), and
    • Enough body rows that the table spans multiple pages.
  2. Ensure at least one cell uses merged rows (rowspan) OR contains tall multi-paragraph content.
  3. Render the document in SuperDoc.
  4. Scroll to the page where the table crosses a page boundary.

Observed:

  • Continuation pages do not show header rows.
  • Some cell content appears outside the table/page safe area.
  • Previous page may show large blank space when a row moves to the next page.

SuperDoc Version

We are currently testing in a fork based on v0.37.0.

Browser & Version

Chrome 143

OS

Windows 10 & Ubuntu 22.04

Additional Context

Suspected root causes

  • Header repetition currently depends on a row-level flag (e.g. tableRowProperties.repeatHeader).

    • Some pipelines represent header rows via header cells (ProseMirror tableHeader) without setting row-level repeatHeader.
    • Result: headerCount becomes 0 → no repeated headers.
  • “Bleeding” can occur when rendering rowspan cells:

    • If a cell spans rows beyond the current fragment range, the renderer can compute a height that extends past the fragment.
    • This creates a cell element taller than the table fragment, which can visually escape into the page safe zone.

Workaround attempts that were rejected

  • Forcing overflow: hidden on the table fragment container clips content and causes missing text; this is not correct pagination.

Presented here is a faulty document with no changes to the SuperDoc package

Image

Checklist

  • Tested with latest version
  • Checked for duplicates
  • Added relevant labels

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions