table或者列表中超出的字用省略号代替的方法(支持IE6)
样式:
.autocut { width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; -icab-text-overflow: ellipsis; -khtml-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; }
HTML代码:
<tr align="center"> <td> <input type="checkbox" name="SonCheck" value="<%#Eval("ID").ToString()%>" /> </td> <td> <%#Eval("StreetName")%> </td> <td> <%#Eval("VillageName")%> </td> <td> //此处添加省略号的代码 <div class="autocut"> <%#Eval("DesignTitle")%></div> </td> <td> <%#Nbsfj.Xxcj.Web.AppCode.Tools.ParseDate(Eval("DesignTime").ToString())%> </td> <td> <img src="http://www.cnblogs.com/App_Themes/Default/images/edt.gif" /><a name='editBtn' value="<%#Eval("ID")%>" href="javascript:void(0)">编辑</a> <img src="http://www.cnblogs.com/App_Themes/Default/images/del.gif" /><a name="delBtn" value="<%#Eval("ID")%>" href="javascript:void(0)">删除</a> </td> </tr>
IE6下测试过也没问题