How can add tag after th:text so that i use br
and em
. Now here name is showing but after that the br tag and and em tag get skipped
Edited and removed the )
<span class="profile" th:text="${user.name}>
<br>
<em class="class_name" th:text="${user.subinfo}></em>
</span>
If you don't want to change the structure of your HTML, you have two alternatives.
Use the <th: block />
tag.
<span class="profile">
<th:block th:text="${user.name}" />
<br>
<em class="class_name" th:text="${user.subinfo}"></em>
</span>
Use the th:inline="text"
attribute.
<span class="profile" th:inline="text">
[[${user.name}]]
<br>
<em class="class_name" th:text="${user.subinfo}"></em>
</span>