我正在尝试显示数据库中的文本。
不会显示预期的换行符,但
我想像这样使用它 {course.overview}
。
当我使用这个
这不完全是我想要的,但它比 {course.overview}
更好。
我能做些什么?
我尝试在
与
{course.overview}
但它没有任何改变。
图片例如 textarea= https://ibb.co/zSmmHrT AND p = https://ibb.co/1L07Dfk
提前致谢! :)
I am trying to display text from my database. The <p>
doesn't show the expected newlines but <textarea>
does.
I want to use it like this <p>{course.overview}</p>
.
When I use this one <textarea type="text" placeholder={course.overview} className="form-control color-black overflow:scroll" name="overview" rows="95" disabled/>
it keeps the format.
It's not exactly what I want but it's better than <p>{course.overview}</p>
.
What can I do?
I tried to use same className in <textarea type="text" placeholder={course.overview} className="form-control color-black overflow:scroll" name="overview" rows="95" disabled/>
with
<p className="form-control color-black overflow:scroll" >{course.overview}</p>
but it changes nothing.
Pictures for example textarea= https://ibb.co/zSmmHrT AND p = https://ibb.co/1L07Dfk
Thanks in advance ! :)
发布评论
评论(1)
如果它是纯文本,您可以使用
有关此问题的更多信息,请参见:https://www.w3schools.com/html/html_paragraphs.asp
Instead of using the
<p>
tag you could use the<pre>
tag if it's plain text. Otherwise you would need to convert all your newlines with<br>
More about the issue here: https://www.w3schools.com/html/html_paragraphs.asp