资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

用javascript 控制php生成的一个表格,出现断线,大侠帮忙

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

 
    表格行数在一页内可以,但是要是很多页,打印的表格会出现断线,很不好看,有什么好的解决方法吗?  
   
  看了二个例子:  
  P   {page-break-after:   always}    
   
  <br   page-break-after:   always>  
  不太会使呀  
   
  <html>  
  <head>  
  <title>print</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;  
  }  
  @media   print   {.no_print{display:   none;}}  
  </style>  
  <script   language="VBScript">    
  dim   hkey_root,hkey_path,hkey_key    
  hkey_root="HKEY_CURRENT_USER"    
  hkey_path="\Software\Microsoft\Internet   Explorer\PageSetup"    
  function   pagesetup_null()    
  on   error   resume   next    
  Set   RegWsh   =   CreateObject("WScript.Shell")    
  hkey_key="\header"    
  RegWsh.RegWrite   hkey_root+hkey_path+hkey_key,""    
  hkey_key="\footer"    
  RegWsh.RegWrite   hkey_root+hkey_path+hkey_key,""    
  end   function    
  </script>    
  <script   language="JavaScript">  
  function   print_report(){  
  if   (confirm(确定打印吗?))   {    
    self.print();    
    }    
  }  
  </script>  
  </head>  
   
  <body   leftmargin="0"   topmargin="0"   onLoad="pagesetup_null()">  
  <table   width="100%"   border="0"   cellpadding="0">  
  <tr>    
  <td>   <form   name="form1"   method="post">  
  <table   border="0"   align="center"   cellpadding="0"   cellspacing="0">  
  <tr>    
  <td>   </td>  
  <td   width="51%"><div   align="right">   </div></td>  
  </tr>  
  <tr>    
  <td   colspan="2">   <table   border="0"   class="tabp"   align="center"   cellpadding="2"   cellspacing="0"   bgcolor="#000000">  
   
  <?  
  for($i=0;$i<=120;$i++){  
  ?>  
  <tr>    
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td></td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  <td   class="tdp"   bgcolor=#FFFFFF>   </td>  
  </tr>  
  <?  
  }  
  ?>  
   
  </table></td>  
  </tr>  
  <tr>    
  <td   colspan="2">   </td>  
  </tr>  
  </table>  
  </form></td>  
  </tr>  
  <tr>  
  <td   height="19"><center><input   type=button   name="printsub"   value="   打印   "   onclick="print_report();"   class="no_print">  
  </center>  
   
  </td>  
  </tr>  
  </table>  
   
  </body>  
  </html>    
     
 

网友回答:

发表者:syre

和php没关系,看看其他网站的可打印版本是怎么做的


 

 
热门推荐笔记本: 索尼笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved