samuel toh samuel toh - 1 year ago 41
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

Answer Source

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