0

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

2
  • 7
    Printing support in browsers generally is laughably terrible. Commented May 31, 2013 at 13:39
  • what if the table or div is more than a page long? How can you avoid a break inside it? Commented May 31, 2013 at 14:16

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you it seems its works indeed i just thougth it did not work of what i had read. in fact The code of my site was just wrong
0

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;

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.