function preview()
{
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
//prnform.htext.value=prnhtml;
//prnform.submit();
//alert(prnhtml);
}
</script>
</head>
<center>本部分以上不被打印</center>
<!--startprint-->
<table width="84%" align="center" bgcolor="#0000FF" cellpadding="2" cellspacing="1">
<tr bgcolor="#6699FF">
<td>
<div align="center">标题一</div>
</td>
<td>
<div align="center">标题二</div>
</td>
<td>
<div align="center">标题三</div>
</td>
<td>
<div align="center">标题四</div>
</td>
<td>
<div align="center">标题五</div>
</td>
</tr>
<tr bgcolor="#6699FF">
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<!--endprint-->
<center>本部分以下不被打印</center>
<div align="center">
<input type="button" name="print" value="预览并打印" οnclick="preview()">
<input class=Noprn type=button οnclick="window.print()" value="print">