From: http://blog.csdn.net/single_killer/article/details/7101901
最简单的可以通过CSS来设置省略号,
鼠标移上全部显示用ToolTip,
1.CSS:
<style type="text/css">
.mlength
{
display: block;
width: 100px;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
</style>
2.设置GeidView某一字段为模板列并设置css,如:
<asp:Label ID="Label1" runat="server"title='<%# Eval("字段") %>'Text='<%# Eval("字段") %>' CssClass="mlength"></asp:Label>
注意:<td>等块中IE可能不能截断,可外面套层<div>