Forum How do I...?

Do not cut last lines of a table from a page to the next page

skoleva
Hello,

Is it possible to not cut the last lines from a page to the next page in a table when the place is not sufficient? I mean if the last line cannot fit in the page, this line to start on the next.

The header of the table is repeated on every page until its end.
mikeday
I'm not sure exactly what it is you want. If the last line cannot fit on the current page, it will already be moved to the next page, is there some other change you would like?
skoleva
Sorry, maybe I was not clear.
Yes, it will be moved, but I want if the line cannot fit on the current page, the whole line (data/information) to start on the next page. I don't know if it's possible but I wanted to ask.
mikeday
You can apply "page-break-inside: avoid" to the element, or use "page-break-before: avoid". Perhaps you could attach an example.
skoleva
I attached the CSS that I'm using and an example of the problem that I want to solve.
In page1.png you can see that the information in the 6th column cannot fit on the same page and the rest of the text goes to the other page (page2.png). I want to avoid this situation like the whole row sample text starts on the next page.
  1. example.css0.8 kB
    CSS
  2. page1.png10.5 kB
    Page 1
  3. page2.png56.4 kB
    Page 2
skoleva
Mike,

I just tried with
table tr {
   page-break-inside: avoid;
}


and it seems to work.