Zeynab
Zeynab

Reputation: 1

How add new line after each iteration in thymeleaf?

How can I add new line after each iteration in thymeleaf? th:each generated content is rendered on a single line.

<div th:each="table: ${mapEntry.value}">
    <div>
        <span th:text="${table}"></span>
    </div>
 </div>

Upvotes: 0

Views: 2684

Answers (2)

Ketan Bhavsar
Ketan Bhavsar

Reputation: 5396

mrtasln is correct. Even you can add one more <div>&nbsp;</div> or set some stylesheet with adding padding / margins for bottom.

<div th:each="table: ${mapEntry.value}">
    <div>
        <span th:text="${table}"></span>
    </div>
    <div>
        &nbsp;
    </div>
</div>

Upvotes: 0

mrtasln
mrtasln

Reputation: 614

You can do it with using <br> or <hr> tag before each statement finish.

<div th:each="table: ${mapEntry.value}">
    <div>
        <span th:text="${table}"></span>
    </div>
    <br/>
</div>

Upvotes: 1

Related Questions