matthy
matthy

Reputation: 8334

Don't break pages in between a table

As I was looking for a solution I found this: Preventing Page Breaks in a Table When Printing

.reportTable {
    page-break-inside: avoid;
}

It was sad to see that it only works in opera. Does anyone know a solution to not let tables and div's to be broken?

Also the previous asker told:

.reportTable {
    page-break-after: always;
}

Can be used but leaves a lot of useless space

Upvotes: 0

Views: 149

Answers (2)

Rafiqul Islam
Rafiqul Islam

Reputation: 961

The page-break-inside CSS property adjusts page breaks inside the current element.

/* Keyword values */
page-break-inside: auto;
page-break-inside: avoid;

/* Global values */
page-break-inside: inherit;
page-break-inside: initial;
page-break-inside: unset;

Upvotes: 0

mrmoje
mrmoje

Reputation: 3732

Maybe you could try that property on the latest browsers.

Firefox seems to support it at version >= 19.0
Chrome seems have always supported it since v1.0
Internet Explorer since v8
Opera since v7.0

Source :- https://developer.mozilla.org/en-US/docs/Web/CSS/page-break-inside

Upvotes: 1

Related Questions