Basic question, can’t figure it out. How do I add a line break to the code?
Currently the below code is returning:
“placeholderName – 5★”
How can I get it to return
“placeholderName
– 5★”
rows[i]["placeholderRating"] = placeholderName + " -- " + rating + " ★"
Have you tried a \n or using a template literal?
\n does not work. Perhaps because I am setting a table value as opposed to just text? I have no idea what a template literal is. Easy to put together?
Are you trying to display this in the table? What type is the column?
Yes, this is just a snippet of the code. It’s actually part of a loop that populates a column in a table. I believe it is just string type
If you want a line break to show up you’ll probably need to make it a rich text column and use a
to create a line break.
Worked like a charm. Thanks Sam.
Solution:
cols9[1].type = "richText";
rows[i]["placeholderRating"] = placeholderName + "<br>" + rating + " ★"
Could you show the full code? I’m facing the same issue and want to display line breaks in a table. However, using Text
and Rich Text
doesn’t work. Text
doesn’t break lines, and Rich Text
displays all the HTML code, which is not the desired outcome.
Thanks a lot