I would like to display some text in a simple div that has a flexible width (width is set to % of parent container).
Sometimes text is too long to be displayed in the correct way so I want to parametrize how many rows it could have.
The rest of the text should be cut, and after the last word that can be displayed there should be ...
.
For example if the text is my simple example text that should be displayed in the custom div by using css
and the parameter of numberOfRows
is set to 1 it should look like:
my simple example text...
and if then parameter of numberOfRows
is set to 2 it should look like:
my simple example text
that should be display...
My current container is just a div but if it is necessary it could be anything:
<div class="simplyText">
my simple example text that should be display in the custom div by using css
</div>
How is it possible to do that?