选择显示字体大小

一段很小但很实用的css打印类(附例子及效果图)


   <html>
<head>
<title>untitled document</title>
<meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=gb2312&quot;>
<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>

<body onbeforeprint=&quot;printsub.style.display=&#39;none&#39;;&quot; onafterprint=&quot;printsub.style.display=&#39;&#39;;&quot;>
<center><input type=button name=&quot;printsub&quot; value=&quot; 打印 &quot; onclick=&quot;self.print();&quot;><br></center>
<table width=&quot;90%&quot; border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot;  class=&quot;tabp&quot;>
  <tr align=&quot;center&quot;>
    <td height=&quot;25&quot; colspan=&quot;3&quot; class=&quot;tdp&quot;><strong>计算机世界开发者俱乐部</strong></td>
  </tr>
  <tr>
    <td width=&quot;31%&quot; height=&quot;26&quot; align=&quot;center&quot; class=&quot;tdp&quot;>php版</td>
    <td width=&quot;34%&quot; align=&quot;center&quot; class=&quot;tdp&quot;>delphi版</td>
    <td width=&quot;35%&quot; align=&quot;center&quot; class=&quot;tdp&quot;>java版</td>
  </tr>
  <tr>
    <td height=&quot;40&quot; colspan=&quot;3&quot; class=&quot;tdp&quot;><p>一段很小但很实用的css打印样式。一般带背景的表格在打印的时候,页面上看到的格线实际却打印不出来。其实不是打印不出来,是需要在打印的时候选择&quot;打印背景&quot;。1般不可能要求用户必须做这步。但用样式表&quot;画&quot;出来的格线在打印的时候就能得到&quot;所见即所打&quot;的效果。这效果当然不能和专业的打印控件如&quot;水晶报表&quot;想比,但满足普通的需求还是能够胜任的。</p></td>
  </tr>
  <tr>
    <td height=&quot;59&quot; colspan=&quot;3&quot; class=&quot;tdp&quot;>但在打印的时候,&quot;打印&quot;按纽不能被打印出来,所以就在<body>里用两个事件来控制它,这步很重要。</td>
  </tr>
  <tr>
    <td height=&quot;59&quot; colspan=&quot;3&quot; class=&quot;tdp&quot;>在使用这两个样式时,1个是让<table>的class=&quot;tabp&quot;,然后再它下面的每个<td>的class=&quot;tdp&quot;,<tr>不需要指定。记住,每个<td>都要指定一下。。。。</td>
  </tr>
  <tr>
    <td height=&quot;59&quot; colspan=&quot;3&quot; class=&quot;tdp&quot;>打印效果如图:(打印出的东东不包括菜单,只有下面的内容):</td>
  </tr>
</table>
</body>
</html>


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons