Article From:https://segmentfault.com/q/1010000012150991
Question:

First stick to my code

<tr th:each=" title : ${titles}">
            <th th:text="${title}"></th>
        </tr>

titles It’s an array.

The results are as follows

Generated HTML code

<tr>
                <th>Order < /th>< /tr>< tr>< th> store name < /th>< /tr>< tr>< th> telephone < /th>< /tr>< tr>< th> address < /th>< /tr>

But the effect I want is to want a tr containing 4 th.

<tr>
    <th>Order < /th>< th> store name < /th>< th> telephone < /th>< th> address < /th>< /tr>

How to do it, please.

Answer 0:

Link of this Article: On the thymeleaf iterative array

Leave a Reply

Your email address will not be published. Required fields are marked *