使用:nth-child(even)选择表格中的偶数行,进行修改背景色,如果选择奇数行,使用odd选择奇数。
使用:last-of-type选择最后一个元素进行画表格底线
使用colspan进行行合并
使用rowspan进行列合并
table自带的border属行显得很生硬。建议请将table的cellspacing设置为1,然后给table设置一个背景,给所有的td设置白色背景,这样td和td之间空出来的一像素就会显示为table背景的颜色形成一种边框效果,宽度和颜色可以随意控制,甚至能使用图片。满意请采纳,谢谢!这个还行<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>