table {
border-collapse: collapse;
width:55em;
table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */
}
.thead th{
width: 63px;
height: 25px;
text-align: center;
}
table td{
position: relative;
/*width: 80px;*/
height: 25px;
text-align: center;
font-size: 12px;
font-weight: normal;
width:100%;
word-break:keep-all;/* 不换行 */
white-space:nowrap;/* 不换行 */
overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
}
table td:hover {
overflow: visible; /* 鼠标放上去显示全部文字 */
}
table设置超出部分隐藏,鼠标移上去显示全部
最新推荐文章于 2022-06-21 13:24:18 发布