Skip to content

The "verticalAlignment" property cannot be correctly applied to the second page. #2925

@jingguanzhang

Description

@jingguanzhang

Thanks @liborm85 for the vertical alignment implementation.

I found a layout bug when a table spans multiple pages.

When a table header cell uses both rowSpan and verticalAlignment: 'middle', it renders fine on the first page. However, from the second page onwards, the text in that cell overflows and shifts outside the cell boundaries.

Minimal repro:

const table = {
            margin: [0, 5, 0, 15],
            table: {
              headerRows: 2,
              widths: ["auto", "*", "*", "*", "auto"],
              body: [
                [
                  { text: "Dept ID", style: "tableHeader", rowSpan: 2, verticalAlignment: "middle" },
                  { text: "Performance Indicators", style: "tableHeader", colSpan: 3 },
                  {},
                  {},
                  { text: "Status", style: "tableHeader", rowSpan: 2 },
                ],
                [{}, { text: "Target", style: "tableHeader" }, { text: "Actual", style: "tableHeader" }, { text: "Gap", style: "tableHeader" }, {}],
                ["D-001", "500", "480", "-20", "In Progress"],
                ["D-002", "300", "350", "+50", "Exceeded"],
                ...
                ["D-003", "750", "750", "0", "Achieved"],
                ["D-004", "200", "180", "-20", "Under Review"],
                ["D-005", "400", "410", "+10", "Achieved"],
              ],
            },
          };

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions