samuel toh samuel toh - 3 months ago 5x
jQuery Question

how to add dots (...) with the same width?

Demo and full code is like this :

When I using :

nm = 'chelsea chelsea chelsea chelsea chelsea chelsea chelsea';

And :
nm = 'iiiii iiiii iiiii iiiii iiiii iiiii iiiii iiiii';

Its width is different

How to keep it the same width?

In some tutorials using css width, but I am confused implementing


You should use a monospace font then.

E.g., add font-family:"Menlo"; (the one Stack Overflow uses for code blocks :)

  font-family: Menlo;
iiiii iiiii iiiii<br>
wkerh werce kjhvg