Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat header in row #2415

Open
stefhivm opened this issue Nov 3, 2023 · 1 comment
Open

Repeat header in row #2415

stefhivm opened this issue Nov 3, 2023 · 1 comment

Comments

@stefhivm
Copy link

stefhivm commented Nov 3, 2023

After exporting and viewing the content in Word, we noticed that the table breaks at the end of a page. We attempted to display the header on every new page using the tableheader:true property, but this resulted in the table being shifted to the next page.

It should be useful if there is property that will repeat header of table in every new page without shiftng table to new page.

new Document({
        sections: [
            {
                children: [
                    new Paragraph({ children: [new TextRun({ text: 'Table title', bold: true })] }),
                    new Table({
                        rows: [
                            new TableRow({
                                children: [
                                    new TableCell({ children: [new Paragraph('Header1')] }),
                                    new TableCell({ children: [new Paragraph('Header2')] }),
                                    new TableCell({ children: [new Paragraph('Header3')] })
                                ],
                                tableHeader: true
                            }),
                            new TableRow({
                                children: [
                                    new TableCell({ children: [new Paragraph('Sed quis maximus sem, a porta tellus. Etiam nec leo molestie turpis suscipit blandit. Aenean eget purus eget massa pretium suscipit id nec nunc. Mauris ligula massa, dictum sed est in, venenatis mattis lacus')] }),
                                    new TableCell({ children: [new Paragraph('Praesent a vestibulum enim, sit amet consectetur est. Nunc suscipit tellus sed lobortis iaculis. Nulla facilisi. Fusce convallis eget ligula a aliquam. Pellentesque habitant morbi tristique senectus et netus')] }),
                                    new TableCell({ children: [new Paragraph('Praesent a vestibulum enim, sit amet consectetur est. Nunc suscipit tellus sed lobortis iaculis. Nulla facilisi. Fusce convallis eget ligula a aliquam. Pellentesque habitant morbi tristique senectus et netus')] })
                                ]
                            }),
                            new TableRow({
                                children: [
                                    new TableCell({ children: [new Paragraph('Sed quis maximus sem, a porta tellus. Etiam nec leo molestie turpis suscipit blandit. Aenean eget purus eget massa pretium suscipit id nec nunc. Mauris ligula massa, dictum sed est in, venenatis mattis lacus')] }),
                                    new TableCell({ children: [new Paragraph('Praesent a vestibulum enim, sit amet consectetur est. Nunc suscipit tellus sed lobortis iaculis. Nulla facilisi. Fusce convallis eget ligula a aliquam. Pellentesque habitant morbi tristique senectus et netus')] }),
                                    new TableCell({ children: [new Paragraph('Praesent a vestibulum enim, sit amet consectetur est. Nunc suscipit tellus sed lobortis iaculis. Nulla facilisi. Fusce convallis eget ligula a aliquam. Pellentesque habitant morbi tristique senectus et netus')] })
                                ]
                            })
                        ]
                    })
                ]
            }
        ]
    })

Actual result:
Screenshot (50)

Expected result:
Screenshot (48)

@stefhivm
Copy link
Author

stefhivm commented Nov 8, 2023

Any update on above mentioned issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant