Check the following steps;
=> Write the whole content in a div tag
=> Open a popup window write the contents into that window
=> Print the popup window
=> Close the popup window.
var printContent = document.getElementById("txtDiv");
var Win4Print = window.open('','','left=0,top=0,width=500,height=500,top=301,left=365,resizable=1,status=0,toolbar=0');
i have little bit different situation ... i need all the pages to contain header and footer...... for some record if am taking the print out then its coming in one page if data is small....but in some cases my jsp is going for 4 pagees....... in that situation header is coming in the first page and footer is coming in the last page........can it possible to do something which will set the header and footer for all the pages.......???///