html + limit in text column
Im trying to use html and limit words in a text column but it doesnot respect html format showing tags:
is there a way to use both?
Solution:Jump to solution
They are both using
formatStateUsing()
under the hood so they overwrite each other. Check the code of both methods and combine them4 Replies
Solution
They are both using
formatStateUsing()
under the hood so they overwrite each other. Check the code of both methods and combine themI would highly recommend not doing this. If you limit the rendered HTML you are going to have problems with the HTML tags getting cut off, which will more than likely break your table layout.
Sorry for reopening the thread. But I have case that I want to show the excerpt of the field but don't want it to show all the html tag (u know, it looks weird for the user).
you can use this
which will strip any html tag and limit it by 50 words
I'm limiting by words this way: (it's very readable 'cause it's the Laravel way!)