Skip to content

Problem with horizontalPageBreak with colspan column header #1032

Description

@first5455

Hi. I have a problem with colspan column when use with horizontalPageBreak. I expected that header3 will repeat when horizontalPageBreak to another page. Any idea?

image_2024-02-07_131425624
image_2024-02-07_131510585

I set data of header like this or maybe I do it wrong?

const daylist = ['day1'........]
const headers = [
            [
                {
                    content: "header1",
                    rowSpan: 2,
                    styles: {halign: "left", valign: "middle", minCellWidth: 50},
                },
                {
                    content: "header2",
                    rowSpan: 2,
                    styles: {halign: "left", valign: "middle", minCellWidth: 500},
                },
                {
                    content: "header3",
                    colSpan: daylist.length,
                    styles: {halign: "left", valign: "middle"},
                },
            ],
            daylist,
        ];

doc.setFont("Arial Unicode MS");
        doc.autoTable({
            head: headers,
            body: rows.map((row) => Object.values(row)),
            styles: {
                font: "Arial Unicode MS",
                halign: "center",
                overflow: "linebreak",
            },
            horizontalPageBreak: true,
            horizontalPageBreakBehaviour: "immediately",
            horizontalPageBreakRepeat: [0, 1],
            tableWidth: "warp",
            pageBreak: "avoid",
            rowPageBreak: "auto",
        });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions