bulrush Posted August 10, 2010 Share Posted August 10, 2010 I have an HTML table which could span 10-50 pages. When I print this HTML page to the printer, how do I prevent the printer from printing part of a row on one page, and part on the next page? I do not rows to break across pages. Thanks. Quote Link to comment Share on other sites More sharing options...
Festy Posted August 11, 2010 Share Posted August 11, 2010 Minimize the size of your table to fit the size of printer page. Also make use of 'print preview' option to make sure rows don't break out. Quote Link to comment Share on other sites More sharing options...
bulrush Posted August 11, 2010 Author Share Posted August 11, 2010 Minimize the size of your table to fit the size of printer page. Can't do that. Printout could be 10-50 pages or more. Also make use of 'print preview' option to make sure rows don't break out. Customer won't do that. This process must be 100% automatic, no user intervention is possible. Quote Link to comment Share on other sites More sharing options...
XeNoMoRpH1030 Posted August 11, 2010 Share Posted August 11, 2010 Not sure if this is what you are looking for, but CSS: page-break-inside: avoid I've never tried it, but a quick search yielded that. Maybe add that to the table or rows. Quote Link to comment Share on other sites More sharing options...
bulrush Posted August 11, 2010 Author Share Posted August 11, 2010 I believe many of the "page-break" thingies are not supported by Firefox or other browsers. Thanks for trying. Quote Link to comment Share on other sites More sharing options...
linus72982 Posted August 11, 2010 Share Posted August 11, 2010 I bet you could work up a script that could determine the length of the table, figure out how many full rows you can fit on a page even if the height of the rows are variable and then break the table after that to continue on the next page. Do you know enough of PHP to do this yourself or do you need a push in the right direction? Of course, this method would display the table in an odd way, with a few empty rows or whitespace every page, but it should solve your problem. Quote Link to comment Share on other sites More sharing options...
linus72982 Posted August 11, 2010 Share Posted August 11, 2010 Actually, thinking on it more, you could even have it display correctly and print differently with CSS style switching based on print action. Quote Link to comment Share on other sites More sharing options...
bulrush Posted August 11, 2010 Author Share Posted August 11, 2010 Thanks for the help but this is not worth the time involved in coding it. I just thought there was an option I could turn on somewhere to prevent a single row from breaking during print. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.