还有,最右上端出现页码,我想把这个页码放到最后一行中间怎么弄,一定要在程序中实现,哪位做过这方面的事情?
8 个解决方案
#1
关注
#2
<script language="JavaScript">
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
}
//设置网页打印的页眉页脚为默认值
function PageSetup_Default()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
}
catch(e){}
}
</script>
<input type="button" value="清空页码" onclick=PageSetup_Null()>
<input type="button" value="恢复页码" onclick=PageSetup_Default()>
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
}
//设置网页打印的页眉页脚为默认值
function PageSetup_Default()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
}
catch(e){}
}
</script>
<input type="button" value="清空页码" onclick=PageSetup_Null()>
<input type="button" value="恢复页码" onclick=PageSetup_Default()>
#3
up
#4
不行啊
我把你的这段代码放到我的打印函数里面,打印结果和以前还是一样,下面是我的打印函数:
<script language="javascript">
function printLetter()
{
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
ie4 = ((navigator.appName == "Microsoft Internet Explorer") &&(parseInt(navigator.appVersion) >= 3 ))
if(ie4)
{
szAll=document.body.innerHTML;
szHeader=document.printheader.innerHTML;
szBody=document.printbody.innerHTML;
szPrint=document.all.print.innerHTML;
document.body.innerHTML="<table width=800><tr><td>" + szHeader + "</td></tr>"+szBody+"</table>";
document.all.print.innerHTML="";
window.print();
document.all.print.innerHTML=szPrint;
document.body.innerHTML=szAll;
}
else
window.print();
}
</script>
我把你的这段代码放到我的打印函数里面,打印结果和以前还是一样,下面是我的打印函数:
<script language="javascript">
function printLetter()
{
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
ie4 = ((navigator.appName == "Microsoft Internet Explorer") &&(parseInt(navigator.appVersion) >= 3 ))
if(ie4)
{
szAll=document.body.innerHTML;
szHeader=document.printheader.innerHTML;
szBody=document.printbody.innerHTML;
szPrint=document.all.print.innerHTML;
document.body.innerHTML="<table width=800><tr><td>" + szHeader + "</td></tr>"+szBody+"</table>";
document.all.print.innerHTML="";
window.print();
document.all.print.innerHTML=szPrint;
document.body.innerHTML=szAll;
}
else
window.print();
}
</script>
#5
关注,我也一样
#6
唉!IE中:文件->页面设置->页眉、页脚全部设为空的就行了!
#7
同意楼上!
#8
严重同意 javaoldmouse(凤凰涅盘)
#1
关注
#2
<script language="JavaScript">
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
}
//设置网页打印的页眉页脚为默认值
function PageSetup_Default()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
}
catch(e){}
}
</script>
<input type="button" value="清空页码" onclick=PageSetup_Null()>
<input type="button" value="恢复页码" onclick=PageSetup_Default()>
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
}
//设置网页打印的页眉页脚为默认值
function PageSetup_Default()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&w&b页码,&p/&P");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"&u&b&d");
}
catch(e){}
}
</script>
<input type="button" value="清空页码" onclick=PageSetup_Null()>
<input type="button" value="恢复页码" onclick=PageSetup_Default()>
#3
up
#4
不行啊
我把你的这段代码放到我的打印函数里面,打印结果和以前还是一样,下面是我的打印函数:
<script language="javascript">
function printLetter()
{
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
ie4 = ((navigator.appName == "Microsoft Internet Explorer") &&(parseInt(navigator.appVersion) >= 3 ))
if(ie4)
{
szAll=document.body.innerHTML;
szHeader=document.printheader.innerHTML;
szBody=document.printbody.innerHTML;
szPrint=document.all.print.innerHTML;
document.body.innerHTML="<table width=800><tr><td>" + szHeader + "</td></tr>"+szBody+"</table>";
document.all.print.innerHTML="";
window.print();
document.all.print.innerHTML=szPrint;
document.body.innerHTML=szAll;
}
else
window.print();
}
</script>
我把你的这段代码放到我的打印函数里面,打印结果和以前还是一样,下面是我的打印函数:
<script language="javascript">
function printLetter()
{
var HKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
ie4 = ((navigator.appName == "Microsoft Internet Explorer") &&(parseInt(navigator.appVersion) >= 3 ))
if(ie4)
{
szAll=document.body.innerHTML;
szHeader=document.printheader.innerHTML;
szBody=document.printbody.innerHTML;
szPrint=document.all.print.innerHTML;
document.body.innerHTML="<table width=800><tr><td>" + szHeader + "</td></tr>"+szBody+"</table>";
document.all.print.innerHTML="";
window.print();
document.all.print.innerHTML=szPrint;
document.body.innerHTML=szAll;
}
else
window.print();
}
</script>
#5
关注,我也一样
#6
唉!IE中:文件->页面设置->页眉、页脚全部设为空的就行了!
#7
同意楼上!
#8
严重同意 javaoldmouse(凤凰涅盘)