Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
like

i am displaying some Keywords in
  • <\li> <\ul>

    as the
    • having fixed with so if the keyword is long how can i manage with

      KEYWORDNAME = KEYWORDNAME..
Posted

Add ellipsis style to li tag. It will automatically add .. after text if required otherwise show normal text.

C#
<ul><li style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:20px">Add your text here to test</li></ul>


Refer this link for help
http://stackoverflow.com/questions/9507555/css-text-overflow-ellipsis-causes-lis-number-to-dissapear
 
Share this answer
 
v2
Comments
sr_24 11-Mar-13 5:53am    
my Visual studio 2008 doesnot support css3 text-overflow:ellipsis ...can there be any alternative solution ?? in css2
pradiprenushe 11-Mar-13 6:00am    
Instead of creating class in css you can directly add style then you dont face css version issue.
sr_24 11-Mar-13 6:05am    
thanks
pradiprenushe 11-Mar-13 6:06am    
welcome
C#
string strText = "Pakistan is my Country";
           if (strText.Length > 10)
           {
               string abcText = strText.Substring(0, 8) + "..";
           }
 
Share this answer
 
Comments
sr_24 11-Mar-13 6:04am    
thanks Pakistan bhai ..i hv used it like this

for (int k = 0; k <= t; k++)
{
if (arr[k].Length > 15)
{
arr[k]= arr[k].Substring(0, 12) + " ..";
}

Display_Keywords.InnerHtml += "<li>"
+ "" + arr[k] + " "
+ "</li> ";
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900