everyone! Could someone tall me how I can limit count of line of text, that is showing in asp.net Labe开发者_JAVA技巧l control? Thanks!
You could use this css to define a max width for the cell(or the outer container). To define a max length of the text, you have to truncate the text to your maximum length by yourself.
.longtext td{ width:100px;word-wrap : break-word ;word-break : normal; }
<asp:Label ID="lblText" runat="server" CssClass="longtext">
lblText.Text=lblText.substring(0,yourMaxLength)
Make changes .css
.limitWidth {
white-space: nowrap;
max-width: 100px;
text-overflow: ellipsis;
overflow-x: hidden;
}
精彩评论