打印页面时如何在新页面中传递内容

时间:2016-05-12 10:10:05

标签: javascript asp.net

enter image description here

见上面我的页面结构,但是当我打印多个学生详细信息时,它没有在我尝试使用的单独页面上显示

 page-break-inside:avoid;page-break-after:auto; 

但它不起作用

使用我的javascript示例代码

     table += '<table style="width: 90%"><tr><td style="width: 5%;"><b>SR. NO.</b></td><td style="width: 15%;"><b>COURSE CODE</b></td><td align="center"><b>COURSE NAME</b></td><td style="width: 15%;"><b>GRADE</b></td><td style="width: 15%;"><b>COURSE CREDITS</b></td></tr>';
    table += SubCal + '</table>';
     table += '</td></tr><tr><td style="height: 5%; border: none; font-size: 12px;">';
       table += '<table border="1" style="width: 99.70%"><tr><td colspan="3" align="center"><b>TRIMESTER PERFORMANCE INDEX (TPI)</b></td><td colspan="3" align="center"><b>CUMULATIVE PERFORMANCE INDEX (CPI)</b></td></tr><tr><td align="center" style="width: 16%;">CREDITS</td><td align="center" style="width: 20%;">EARNED GRADE POINTS</td><td align="center" style="width: 16%;">TPI</td><td align="center" style="width: 16%;">EARNED CREDITS</td><td align="center" style="width: 20%;">EARNED GRADE POINTS</td> <td align="center" style="width: 16%;">CPI</td></tr>';
 table += '<tr><td align="center">' + e.d[a].Term_Credits + '</td><td align="center">' + e.d[a].Total_Earned_Credits + '</td> <td align="center">' + e.d[a].Tpi + '</td><td align="center">' + e.d[a].Total_Credits + '</td><td align="center">' + e.d[a].Earned_Grd_Points + '</td><td align="center">' + e.d[a].Cpi + '</td></tr></table>';
 table += '<div style=" page-break-after: always;">';
 document.getElementById("tbl_Master").innerHTML = table;

我的HTML部分

 <div id="tbl_Master"></div>

page-break-after: always;  
it will work for only html but  when I am passing data using javascript dynamically not working for me

0 个答案:

没有答案