Is there anyway, using JavaScript or CSS to prevent page breaks inside of <tr> elements in Firefox? I’m assuming since FF still doesn’t support page-break-inside that this has to be done in JavaScript but not sure how to go about it. All of our users use the same type of printer with fixed margin sizes.
Thanks!
You could use JS to detect the height of cells and when the sum is more than what you guess is the size of the page is, and style=”page-break-after:always”. Just make sure you leave some margin, to avoid pages with only one row.
Another thing you could do is add a extra column. In every cell in this column put an img element containing a blank image (spacer). Use JS to give each image the height of the cell (and width of 1px). Firefox seems to avoid cutting up images, so will display the row on a new page.
Please not that the height of the cell on the screen might be different than when is it printed. On the screen the table might be wider, than a sheet of paper.