Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
利用css实现的表格样式展示_创想鸟

利用css实现的表格样式展示

利用css实现的表格样式展示

本文为大家展示了几款美观的表格样式,希望大家可以喜欢。

1、单像素边框CSS表格

304c1df3f99e85fdab413bbf574e684.png

table.gridtable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #666666;border-collapse: collapse;}table.gridtable th {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #dedede;}table.gridtable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #666666;background-color: #ffffff;} 
Info Header 1Info Header 2Info Header 3
Text 1AText 1BText 1C
Text 2AText 2BText 2C

(视频教程推荐:css视频教程)

2、带背景图的CSS样式表格

立即学习“前端免费学习笔记(深入)”;

1afd6edfb3d7444e16ca5573462a88c.png

table.imagetable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #999999;border-collapse: collapse;}table.imagetable th {background:#b5cfd2 url('cell-blue.jpg');border-width: 1px;padding: 8px;border-style: solid;border-color: #999999;}table.imagetable td {background:#dcddc0 url('cell-grey.jpg');border-width: 1px;padding: 8px;border-style: solid;border-color: #999999;} 
Info Header 1Info Header 2Info Header 3
Text 1AText 1BText 1C
Text 2AText 2BText 2C

3、自动换整行颜色的CSS样式表格(需要用到JS)

8a5be293f679052cfabaaa88d1c128b.png

function altRows(id){if(document.getElementsByTagName){  var table = document.getElementById(id);  var rows = table.getElementsByTagName("tr");  for(i = 0; i < rows.length; i++){          if(i % 2 == 0){rows[i].className = "evenrowcolor";}else{rows[i].className = "oddrowcolor";}      }}} window.οnlοad=function(){altRows('alternatecolor');}  table.altrowstable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #a9c6c9;border-collapse: collapse;}table.altrowstable th {border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;}table.altrowstable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;}.oddrowcolor{background-color:#d4e3e5;}.evenrowcolor{background-color:#c3dde0;}  
Info Header 1Info Header 2Info Header 3
Text 1AText 1BText 1C
Text 2AText 2BText 2C
Text 3AText 3BText 3C
Text 4AText 4BText 4C
Text 5AText 5BText 5C

4、鼠标悬停高亮的CSS样式表格 (需要JS)

781233b2e353118c38e6b54cbafad81.png

table.hovertable {font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #999999;border-collapse: collapse;}table.hovertable th {background-color:#c3dde0;border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;}table.hovertable tr {background-color:#d4e3e5;}table.hovertable td {border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;} 
Info Header 1Info Header 2Info Header 3
Item 1AItem 1BItem 1C
Item 2AItem 2BItem 2C
Item 3AItem 3BItem 3C
Item 4AItem 4BItem 4C
Item 5AItem 5BItem 5C

推荐教程:css快速入门

以上就是利用css实现的表格样式展示的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1615243.html

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
“margin:0 atuo;” 是什么意思?
上一篇 2025年12月24日 04:49:26
结构性伪类选择器—nth-child实现彩色表格案例(代码实例 )
下一篇 2025年12月24日 04:49:55

相关推荐

发表回复

登录后才能评论
关注微信