How I finally figured out how to deal with stupid overflowing text

So I have randomly come across this issue where I’ve got text that needs to fit into a specific area – not all the text needs to show, but enough of it so you know what’s going on there, content-wise. This seems to happen with table data, and of course I’ve got to deal with how the content moves around on smaller screens – and usually it’s a case of where everything needs to stay on one line. So I’ve done some half-assed php character limiting, where really there was a much more elegant solution sitting out there waiting for me this entire time.

white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

I feel kinda dirty about the fact that I discovered this via Yahoo’s homepage, but I’ll take what I can get.

Leave a Reply