I am developing an application where i have to display names of users in following structure :

In above structure, in the name field, it may exceed the right border of the outer <div> tag, i want to cut the name value just before it touches the right border and append the a string ‘…’ in the end just like below

How can i make it work for UTF-8, unicode or Normal english letters in the name field?
P.S. I m using PHP for server side processing.
The easiest way is to set some CSS on that div…
<div style="white-space:nowrap; text-overflow:ellipsis;">Er. Christopher Allen (ChristAllenMoreTextMoreText)</div>You have to set the
white-spaceattribute as well, otherwise you won’t ever get to this elipsis point. You should also probably setoverflow:hidden.Big caveat though! This does not work in all browsers. IE7 and beyond, Safari/Chrome, are all fine. I believe there are issues with it in Firefox though.
Edit: Here is a Firefox workaround. Not amazing though.