0

I have a sample fiddle here where I have a print preview page in a child window which is drawn as,

myWindow=window.open('','','width=800,height=600','scrollbars=yes');
    myWindow.innerWidth = screen.width;
    myWindow.innerHeight = screen.height;
    myWindow.screenX = 0;
    myWindow.screenY = 0;
    myWindow.document.write(data);
    myWindow.document.close();
    myWindow.focus();

But in Mozilla Firefox, the child window vertical scrollbar is missing. How can I fix this? Also how can I repeat the table header row (ie, Sl.No. and Value) in each page of printed copy? I had tried using

   <style type="text/css" media="print">
        #headerRow {display:table-header-group;}
        tbody {display:table-row-group;} 
        .noprint {visibility: hidden;}
   </style>

But no use.

mpsbhat
  • 2,733
  • 12
  • 49
  • 105

1 Answers1

1
  1. The scrollbar issue is solved by using,

    myWindow=window.open('','','width=800,height=600,scrollbars=yes');

Initially an extra ' was present in between height=600 and scrollbars=yes

  1. The table header is solved by using bootstrap style for logo alignment and using #headerRow {display:table-header-group;} inside media print

DEMO

Anyways the table header is not repeating in chrome browser. Please suggest a fix.

Community
  • 1
  • 1
mpsbhat
  • 2,733
  • 12
  • 49
  • 105
  • 1
    Also use this code and I served `var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes"; this.myWindow = window.open('', '', strWindowFeatures);` – Elias Vargas Apr 19 '16 at 15:26