Reputation: 304
This is my code using the Thymeleaf template
<form>
<label>
<input type="checkbox" th:each="activeMeal : ${activeMeals}" th:text="${activeMeal.itemName}">
</label>
</form>
This is getting generated:
I want each checkbox in a separate line. In a normal plain HTML I would use the <br/>
tag to create the breaks. But it does not seem to be working in inside the Thymeleaf tags.
Upvotes: 2
Views: 2073
Reputation: 304
<th:block th:each="activeMeal : ${activeMeals}">
<input type="checkbox" name="selectedActive" id="selectedActive" th:value="${activeMeal.itemName}"/>
<label th:text="${activeMeal.itemName}"></label>
<br/>
</th:block>
Upvotes: 1