I want to trim a string down to a particular pixel width so that it can properly fit in a container. It will be similar to substring, except that I am trimming based on pixel width as opposed to number of characters. is there a built in function for this?
Share
You can do it via css:
text-overflow: clip;Note: This is not supported in FF < 7. Every other browser including IE6 supports it.
Try this: