Search code examples
javascriptprintingscrollbarchildwindow

Vertical scrollbar is missing in mozilla firefox open child window


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.


Solution

    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.