转自:http://atgoingguoat.iteye/blog/2074431

常用table样式,备自己常年复制用。

 

效果图



 

 

 

Java代码  
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2. <html xmlns="http://www.w3/1999/xhtml">  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
  5. <title>无标题文档</title>  
  6. <style type="text/css">  
  7. <!--  
  8. /************ Table ************/  
  9. .xwtable {width: 100%;border-collapse: collapse;border: 1px solid #ccc;}                  
  10. .xwtable thead td {font-size: 12px;color: #333333;text-align: center;background: url(table_top.jpg) repeat-x top center;border: 1px solid #ccc; font-weight:bold;}  
  11. .xwtable tbody tr {background: #fff;font-size: 12px;color: #666666;}             
  12. .xwtable tbody tr.alt-row {background: #f2f7fc;}                 
  13. .xwtable td{line-height:20px;text-align: left;padding:4px 10px 3px 10px;height: 18px;border: 1px solid #ccc;}  
  14. -->  
  15. </style>  
  16. </head>  
  17.   
  18. <body>  
  19. <table class="xwtable">  
  20.             <thead>  
  21.               <tr>  
  22.                 <td>条数(可去掉这行)</td>  
  23.                 <td>内容(可去掉这行)</td>  
  24.               </tr>  
  25.             </thead>  
  26.             <tbody>  
  27.               <tr>  
  28.                 <td>第1条</td>  
  29.                 <td>内容内容内容</td>  
  30.               </tr>  
  31.               <tr>  
  32.                 <td>第2条</td>  
  33.                 <td>内容内容内容内容</td>  
  34.               </tr>  
  35.               <tr>  
  36.                 <td>&nbsp;</td>  
  37.                 <td>&nbsp;</td>  
  38.               </tr>  
  39.               <tr>  
  40.                 <td>&nbsp;</td>  
  41.                 <td>&nbsp;</td>  
  42.               </tr>  
  43.               <tr>  
  44.                 <td>&nbsp;</td>  
  45.                 <td>&nbsp;</td>  
  46.               </tr>  
  47.             </tbody>  
  48.           </table>  
  49. </body>  
  50. </html>  

更多推荐

HTML常用table样式