html 简单的table样式

本文介绍了四种不同的CSS表格样式实现方法,包括单像素边框表格、带背景图的表格、自动换行颜色的表格及鼠标悬停高亮的表格,并提供了完整的HTML和CSS代码示例。

效果预览:

代码:

  1 <!DOCTYPE html>
  2 <html>
  3 <head>
  4     <meta charset="utf-8">
  5     <title>html 简单的table样式</title>
  6     <style type="text/css">
  7     /* gridtable */
  8     table.gridtable {
   
   
  9         font-family: verdana,arial,sans-serif;
 10         font-size:11px;
 11         color:#333333;
 12         border-width: 1px;
 13         border-color: #666666;
 14         border-collapse: collapse;
 15     }
 16     table.gridtable th {
   
   
 17         border-width: 1px;
 18         padding: 8px;
 19         border-style: solid;
 20         border-color: #666666;
 21         background-color: #dedede;
 22     }
 23     table.gridtable td {
   
   
 24         border-width: 1px;
 25         padding: 8px;
 26         border-style: solid;
 27         border-color: #666666;
 28         background-color: #ffffff;
 29     }
 30     /* /gridtable */
 31 
 32     /* imagetable */
 33     table.imagetable {
   
   
 34         font-family: verdana,arial,sans-serif;
 35         font-size:11px;
 36         color:#333333;
 37         border-width: 1px;
 38         border-color: #999999;
 39         border-collapse: collapse;
 40     }
 41     table.imagetable th {
   
   
 42         background:#b5cfd2 url('cell-blue.jpg');
 43         border-width: 1px;
 44         padding: 8px;
 45         border-style:
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kingofyz

此处弱弱求打赏~~万一有好心人

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值