Create a web block which auto wraps text

Hi

I'm currently trying to design a news board on my homepage and I'd like to fill a table with the contents of a "News" entity that I have. Its attributes are: User, Title and Content.

The content would have the written text related to the news and I'm having some serious issues trying to make the text fill inside a container without it violating the container/screen size. In order to avoid more problems in the future, I'd like to set up a web block which would receive size inputs and a text input and it would automatically set the maximum sizes and wrap the text or trim the string in order to fit the container and possibly have "read more" options at the end of the text.
Anyone knows if this is viable and how to do it? I'm aware of the css codes that exist to wrap text, but often the commands conflict with each other or aren't general enough to be easily implemented all along the project.

Thanks in advance :)

Just to clarify a bit: I'm trying to create a container which contains an "expression" (the content text) which auto breaks words (doable via css) and that shows an ellipsis if the resultant expression is still bigger than the container (here lies the problem, apparently).

You could look at implementing this in your webblock

https://www.viralpatel.net/dynamically-shortened-text-show-more-link-jquery/


You could also go low tech and enable a scrollbar on the div

Hi Bruno (and John),

There are several ways of achieving something similar to what I believe Bruno wants, some are pure CSS, some rely on creativity, some on JavaScript.

You may want to take a look at these interesting article/overview of possibilities for just that: