只打印jsp面中表格部分,页头页脚不要,最后有原代码 解决马上给分
只打印jsp面中表格部分,页头页脚不要,最后有原代码
`` 谢谢```解决马上给分
------解决方案----------------------不知道从来copy来的,参考下.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv= "Content-Type " content= "text/html; charset=GBK " />
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
</HEAD>
<SCRIPT LANGUAGE= "JavaScript ">
<!--
function printBody(){
var allHtmlCode=window.document.body.innerHTML;
var strStart= " <!--print start--> ";
var strEnd= " <!--print end--> ";
var printHtmlCode=allHtmlCode.substr(allHtmlCode.indexOf(strStart)+strStart.length);
printHtmlCode=printHtmlCode.substr(0,printHtmlCode.indexOf(strEnd));
window.document.body.innerHTML=printHtmlCode;
window.print();
window.document.body.innerHTML=allHtmlCode;
}
function onUnLoad(){
alert( "close ");
}
function open_window()
{
var strFeatures = "top=120px,left=120px,width=600px,height=500px,resizable=no,toolbar=no,scrollbars=yes,fullscreen=3 ";
window.open( "C:\\ ", "test ",strFeatures);
}
window.close=function(){
alert( "window.onunload() ");
}
/*function window.onbeforeunload()
{
alert( "window.onbeforeunload() ");
}
window.onbeforeunload = function()
{
if(event.clientX> document.body.clientWidth&&event.clientY <0||event.altKey)
{
window.event.returnValue = " ";
}
}*/
//-->
</SCRIPT>
<script language=javascript>
function window.onbeforeunload()
{
if(event.clientX> document.body.clientWidth&&event.clientY <0||event.altKey)
{
window.event.returnvalue = " ";
}
}
</script>
<BODY onUnLoad= "onUnLoad(); ">
不打印区域
<!--print start-->
打印区域
<!--print end-->
<INPUT TYPE= "button " value= "javaScriptPrint " onclick= "javascript:printBody() ">
<INPUT TYPE= "button " value= "windowPrint " onclick= "javascript:window.print() ">
<INPUT TYPE= "button " value= "windowOpen " onclick= "javascript:open_window() ">
</BODY>
</HTML>
------解决方案--------------------又是找代码的
------解决方案--------------------你把你要打印的用div包起来,给个id,然后打印这个element就是了
------解决方案--------------------呵呵
------解决方案--------------------同意:zhj92lxs()
------解决方案--------------------用http://qq6441.meibu.com 打印工具可以自定义打印格式
------解决方案--------------------好象是leasa(暴暴)那样
------解决方案--------------------踩一脚。
------解决方案--------------------