Is there a way to truncate a string to fit certain box size AND only keep full words?
CSS solution truncates to box size, but breaks words:
.truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
While php truncate cuts the string to number of characters, but not to box length. Eg a string with many i's will take much less space then a string with many M's.
Is there a way to have best of both worlds?