For most part the VF page is rendering correctly as PDF. There is however one scenario that we are not able to find a solution for. Please see below image. It is showing empty table and column header at the end of the page.
This is happening because there is not enough space to print the "tr" and hence it continues on next page.
The document does not look professional. Is there a way to not-show/hide empty table header?
Note: the content is dynamic, so showing "Table 2" on new page always is not an option.
Here is the css
div, table tr { page-break-inside: avoid; }