td文字过多一般的解决方法:
#description_list {
width: 150px;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
display: block;
/*float: left;*/
}
但是如果td包裹的文字太多,会把td设置的宽度撑开,这个时候需要再给table加:table-layout: fixed;
问题就ok了。
txt += ' <td id="description_list" onmouseover="show_shopm(this)" description-data="' + list[i].description + '" style="color:green;cursor:pointer">' + list[i].description + '</td>';
js
//显示商品描述
function show_shopm(t) {
var row = $(t).attr("description-data");
//小tips
layer.tips(row, t, {
tips: [1, '#3595CC'],
time: 4000
});
}