asp.net web实现页面部分打印

function pritinf() {
            var nw = window.open('', '', 'width=800,height=600');
            nw.document.open("text/html", "GB2312");
            nw.document.write('<link rel="stylesheet" type="text/css" href="css/css2.css" />');
            nw.document.write('<body>');
            nw.document.write("<object classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2' id='wb'height='0' width='0'></object>");
            nw.document.write(document.getElementById("div1").outerHTML);//这里document.getElementById("div1").outerHTML改成你的tableID
            nw.document.write("<scrip" + "t>document.all.wb.ExecWB(6,1)</sc" + "ript>");
            nw.document.write('</body>');


        } 

你可能感兴趣的:(asp.net)