td:nth-child(1){
width:30%;
}
td:nth-child(2){
width:60%;
}
td:nth-child(3){
width:10%;
}
tbody>tr td:nth-child(2):hover {
background-color: #01acfe;
width:30%;
}
td:nth-child(2){
width:60%;
}
td:nth-child(3){
width:10%;
}
tbody>tr td:nth-child(2):hover {
background-color: #01acfe;
}
div.histotyTable td:nth-child(3){
text-align: center;
}
table{
table-layout:fixed;
width:100%;
}
td {
word-break: break-all;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}
本文详细介绍了使用CSS进行表格布局的方法,包括各列宽度设置、单元格内容溢出处理及悬停效果实现等。通过具体代码示例,读者可以学习如何创建固定布局的表格,并为表格行的单元格添加鼠标悬停背景颜色变化的功能。
3301

被折叠的 条评论
为什么被折叠?



