Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Intelligent Pagebreaking in a Web page

$
0
0

 

I was confronted with a problem as follows.

I have a Page(ASP/HTML/ASPX) which uses several div's to display the data on th page. I also have a print button and on clicking it I am calling a Print function in JavaScript that prints based upon the div Id.

So far so good, but when I print the page, the div at the end of the page will be split into two pages based upon the length of content in that div. I dont need that. I tried to include page-break-inside:avoid in the style sheet but it does not work with IE and FF which are major client browsers in our organization. So I hope that this approach will not work correctly. Is there any other approach for my problem. Instead of splitting the div, it should entirely include it in the page or the succeeding page.  Please respond ASAP if anylne has a solution. I am posting my JavaScript printing function here for your reference.

function printdiv(printarea){var headstr ="<html><head><title></title></head><body>";var footstr ="</body></html>";var newstr = document.getElementById(printarea).innerHTML;var oldstr = document.body.innerHTML;
			document.body.innerHTML = headstr+newstr+footstr;
			window.print();
			document.body.innerHTML = oldstr;returnfalse;}

 


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>