HTML的表格样式

php中世界最好的语言
php中世界最好的语言 原创
2018-05-15 13:51:37 3719浏览

给大家分享一个好看的HTML的表格样式,这个表格每个格子里都有背景图,


首先你需要下载俩张图,

cell-blue.jpg

cell-grey.jpg

命名为cell-blue.jpg和cell-grey.jpg

拷贝下面的代码到你想要的地方,记得修改图片url

<!-- CSS goes in the document HEAD or added to your external stylesheet -->
<style type="text/css">
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;
}
</style>
<!-- Table goes in the document BODY -->
<table class="imagetable">
<tr>
<th>Info Header 1</th><th>Info Header 2</th><th>Info Header 3</th>
</tr>
<tr>
<td>Text 1A</td><td>Text 1B</td><td>Text 1C</td>
</tr>
<tr>
<td>Text 2A</td><td>Text 2B</td><td>Text 2C</td>
</tr>
</table>

需要的朋友可以直接拿去用,更多精彩请关注php中文网其它相关文章!

相关阅读:

class与id有什么区别

怎么让网页变黑白色

HTML网页字体大小的设置

以上就是HTML的表格样式的详细内容,更多请关注php中文网其它相关文章!

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。