Forum How do I...?

use page-break-inside:avoid without leaving empty space

danielm
Using page-break-inside:avoid to keep an element on one page (where possible) leaves an ugly gap on the preceding page (see attached example). I would prefer the elements of the following page to be moved there (if possible). In the example that would mean that some of the paragraphs with text "after" would show on the page before the table.
  1. float.html2.0 kB
  2. float.pdf11.3 kB
mikeday
You can float the table to the top of the page, with "float: top" or "float: top next" or "float: top unless-fit".
danielm
Thanks.