標籤:style class java ext c color
看到了這篇:
http://www.dev-club.com/club/bbs/ShowAnnounce.asp?ID=2312527
後,查了下MSDN,查到了WebBrowser的東東
再結合偶的
http://www.dev-club.com/club/bbs/showEssence.asp?id=24093&page=2
就整出了這樣的效果:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
.tdp
{
border-bottom: 1 solid #000000;
border-left: 1 solid #000000;
border-right: 0 solid #ffffff;
border-top: 0 solid #ffffff;
}
.tabp
{
border-color: #000000 #000000 #000000 #000000;
border-style: solid;
border-top-width: 2px;
border-right-width: 2px;
border-bottom-width: 1px;
border-left-width: 1px;
}
</style>
</head>
<center>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
</OBJECT>
<div id="printsub">
<input type=button value="列印" onclick="document.all.WebBrowser.ExecWB(6,1)">
<input type=button value="版面設定" onclick="document.all.WebBrowser.ExecWB(8,1)">
<input type=button value="預覽" onclick="document.all.WebBrowser.ExecWB(7,1)">
</div>
</center>
<body onbeforeprint="printsub.style.display=‘none‘;" onafterprint="printsub.style.display=‘‘;">
<table width="90%" border="0" align="center" cellpadding="2" cellspacing="0" class="tabp">
<tr align="center">
<td height="25" colspan="3" class="tdp"><strong>電腦世界開發人員俱樂部</strong></td>
</tr>
<tr>
<td width="31%" height="26" align="center" class="tdp">PHP版</td>
<td width="34%" align="center" class="tdp">DELPHI版</td>
<td width="35%" align="center" class="tdp">JAVA版</td>
</tr>
<tr>
<td height="40" colspan="3" class="tdp"><p>一段很小但很實用的CSS列印樣式。一般帶背景的表格在列印的時候,頁面上看到的格線實際卻列印不出來。其實不是列印不出來,是需要在列印的時候選擇"列印背景"。1般不可能要求使用者必須做這步。但用樣式表"畫"出來的格線在列印的時候就能得到"所見即所打"的效果。這效果當然不能和專業的列印控制項如"水晶報表"想比,但滿足普通的需求還是能夠勝任的。</p></td>
</tr>
<tr>
<td height="59" colspan="3" class="tdp">但在列印的時候,"列印"按紐不能被列印出來,所以就在<body>裡用兩個事件來控制它,這步很重要。</td>
</tr>
<tr>
<td height="59" colspan="3" class="tdp">在使用這兩個樣式時,1個是讓<table>的class="tabp",然後再它下面的每個<td>的class="tdp",<tr>不需要指定。記住,每個<td>都要指定一下。。。。</td>
</tr>
<tr>
<td height="59" colspan="3" class="tdp">列印效果(列印出的東東不包括菜單,只有下面的內容):</td>
</tr>
</table>
</body>
</html>
感謝lran啊~~
msnd中查看WebBrowser的資料:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/vclib/html/vcrefCHtmlViewExecWB.htm
btw:該怎樣分頁呢?CSS好象可以,偶再查查CSS手冊看看。。。
2.不通用的,就是用列印控制項嘍。比如偶單位就有專門WEB列印的東東。