TenJack
TenJack

Reputation: 1632

Printing a webpage with varying div sizes

Is there any way to make it so divs do not get cut in half when printing multiple pages? There are divs that I am trying to print that vary in size and I would like it to print so that none of them are cut off and the full div boxes appear on a single page. Maybe there is a way to calculate the height of each div and if one puts it over the height of the page, then put it on the next page? I know I could get the length of the text within each div and maybe do it that way, but how would I go about designating a div to be printed on another page?

Upvotes: 1

Views: 260

Answers (1)

RoToRa
RoToRa

Reputation: 38431

Use the CSS property page-break-inside:

http://www.w3.org/TR/CSS21/page.html#page-break-props

Upvotes: 1

Related Questions