1.使用CSS实现,给此单元格添加一个Class:
130px;
display:block;
overflow:hidden;
word-break:keep-all;
white-space:nowrap;
text-overflow:ellipsis;
2.使用JQuery实现,表格id="projectName":
$("[id='projectName']").each(function(){ var _self = $(this); var text = _self.text(); text = text.substring(0,15) + "..."; _self.html(text); });