Skip to content

Floating tables (w:tblpPr) render in document flow order, ignoring absolute position #2800

@akhilgopu72

Description

@akhilgopu72

What happened?

SuperDoc's layout engine appears to ignore w:tblpPr on w:tbl elements. Tables with absolute positioning get rendered in document-flow order at the same vertical position as their anchor, rather than at the w:tblpX / w:tblpY offsets specified. This makes multi-column Word layouts render misaligned — the floating tables end up stacked or offset from where they should sit visually

Steps to reproduce

  1. Load a .docx that contains one or more w:tbl elements whose w:tblPr has a w:tblpPr child, e.g.:

    <w:tbl>
      <w:tblPr>
        <w:tblStyle w:val="TableGrid"/>
        <w:tblpPr w:leftFromText="180" w:rightFromText="180"
                  w:vertAnchor="text" w:horzAnchor="page"
                  w:tblpX="7298" w:tblpY="-1314"/>
        <w:tblW w:w="0" w:type="auto"/>
        ...
      </w:tblPr>
      ...
    </w:tbl>
  2. Observe the rendered position in SuperDoc.

Actual behavior

The table renders in document flow order at the location of its anchor paragraph, ignoring w:tblpX and w:tblpY. When the source template intended for this table to sit next to a preceding in-flow table (classic multi-column layout), SuperDoc stacks them instead

Expected behavior

Floating tables should respect the w:tblpPr positioning attributes and render at the computed absolute position relative to the anchor specified by w:vertAnchor / w:horzAnchor.

I don't see tblpPr referenced in the layout path but haven't traced the whole chain. Happy to open a PR if pointed at the right extension point

SuperDoc version

1.26.0

Browser

Chrome

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions