본문 바로가기
Front-End/Thymeleaf

[thymeleaf] th:if

by bang-geus 2024. 7. 30.
  1. thymeleaf에서 if 사용
<div>
	<span th:if="${list.seq == '1'}"></span>
	<span th:if="${list.seq == '2'}"></span>
</div>

 

2. thymeleaf에서 if -else 사용

<div th:if="${list.useYn == 'Y'}">사용</div>
<div th:unless="${list.useYn == 'Y'}">미사용</div>

 

 

 

원문 출처 : 

https://ssd0908.tistory.com/entry/thymeleaf-if-else-%EC%A1%B0%EA%B1%B4%EB%AC%B8-%EC%82%AC%EC%9A%A9%EB%B0%A9%EB%B2%95