end a string in ...

2
Hi! I am building a template to convert to pdf Whenever I try to print and the number of characters are too many, it takes an extra line. I would like it to end abrubtly or end with ... the css solution of text-overflow: ellipsis; does not seem to work (I get an error) thanks in advance, Auke
asked
1 answers
2

It depends on what the exact problem is that you are having. You're saying that you get an extra line, if you mean with this statement that the text moves to the next line rather than showing .... you want fix that using the css white-space statement.

The white-space statement specifies line-wrapping. I tested the following combination of CSS statements, and that worked for me:

white-space: nowrap;       //Prevent the text from breaking to the next line
overflow: hidden;          //Hide the text that is longer than the display area
text-overflow: ellipsis;   //Add the ... at the end of the line if the overflow is hidden
answered