How to allow splitting a <table> and <iframe> at PDF page end when printed?

Assume I want to print a (long) web page into a pdf file.

The web page contains <table> elements and <iframe> elements.

When a <table> or a <iframe> element does not fit on the remaining part of the current pdf page then the WHOLE element is shifted resp. moved to the next pdf page.

How can I avoid this?

If <table> or the <iframe> element does not fit on the remaining part of the current pdf page then it should be cut somewhere in the mid and the remaining lower part printed into the next pdf page.

How can I achieve this (with a CSS attribute)?

You can try using a print stylesheet and and setting the table and iframe to break-inside:avoid.

e.g.

table,iframe {
  break-inside: avoid;
}

Unfortunately nothing is guaranteed where printing is concerned and mileage will vary between, browser, os and printer.