css - how to add header when page breaks when print using javascript? -


i have grid contains more 100 records @ every time.when trying print data using javascript. able print grid data.but problem in every page not having page header , @ sametime final record data missing .i need fix issue me improve

 self.print(); 

i using command initiate print.after that

var gridid = "#grid";     $("#pageheader").show();     $("#pageheader").clone().addclass("clonecopy").appendto("body");     $(gridid).clone().addclass("clonecopy").appendto("body");` 

by coding used print grid in print screen. enter image description here

and need fix 15 records per page , headers(for every page)

 function printcontrol(){          var table = document.getelementbyid("datalist1");         var count = table.rows.length;         (var = 0; < count; i++) {             if ((i % 4 == 0)&&(i!=0)) {                 table.rows[i].style.csstext = "page-break-after:always";             }         }     } 

and using code cant result..

making few assumptions here, similar below:

var count = 0; var page = $('<div></div>'); $('#grid').children().each(function(){     if( count == 0 ){         $("#pageheader").clone().addclass("clonecopy").appendto(page);     }     $(this).clone().addclass("clonecopy").appendto(page);     count += 1;     if( count == 15 ){         page.appendto("body");         page = $('<div></div>');         count = 0;     }   }); 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -