CSS 表格相关属性:http://www.w3school.com.cn/css/css_table.asp
制作漂亮的表格
http://www.w3school.com.cn/tiy/t.asp?f=csse_table_fancy
涉及问题:
(1)表格单边框border-collapse:collapse;(2)文字对齐 text-algin
(3)固定列宽非按内容显示table-layout:fixed(4)不同行不同颜色#customers tr.alt td
<style type="text/css">
#customers
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
#customers td, #customers th
{
font-size:1em;
border:1px solid #98bf21;
padding:3px 7px 2px 7px;
}
#customers th
{
font-size:1.1em;
text-align:left;
padding-top:5px;
padding-bottom:4px;
background-color:#A7C942;
color:#ffffff;
}
#customers tr.alt td
{
color:#000000;
background-color:#EAF2D3;
}
</style>
转载于:https://blog.51cto.com/dyzyxy/1006675