Hackableweb
Hackableweb

Reputation: 372

HTML auto page-breaks for Print

I have to print an invoice that has multiple tables. One table(in which items are listed) has a dynamic content. I am unable to give explicit page breaks as the content is dynamic. When i print the invoice, the table's boxes are split and half of a line is printed on one page and the other half on the next page. How to style the print? Is there any way of giving auto page breaks?

Upvotes: 0

Views: 659

Answers (1)

rhgb
rhgb

Reputation: 4205

CSS rules page-break-after, page-break-before and page-break-inside should help you.

In particular, you may add page-break-inside: avoid to your <table> to prevent it from breaking.

Note: these CSS rules may only try to avoid breakings, and may not work in situations such as a table longer than one page.

Upvotes: 1

Related Questions