i am querying text from a DB. if the text ends to be too long, I want to be able to wrap the text after, say, 400 characters and display a “…” at the end.
how can it be done?
i am querying text from a DB. if the text ends to be too
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would suggest you don’t do it in your query. You are probably rendering in a proportional font which means 400 characters is never the same size. “…” with a lot of white-space behind it is kinda awkward.
You can query the entire field and cut off using CSS (with limited browser support) with: