본문 바로가기
Web/Thymeleaf

[Thymeleaf] th속성 관련

by 평범한kiki 2023. 4. 23.

* Thymeleaf 
- th속성 관련 선언 <html lang="ko" xmlns:th="http://www.thymeleaf.org">
- th:href="@{/css/style.css}"


- th:if="${#lists.size(list)} > 0"  
- th:unless="${#lists.size(list)} > 0"    //list> 0 아니라면


- th:each="list: ${list}"              //반복 
   예] <tr th:if="${#lists.size(list)} > 0" th:each="list : ${list}">

 

- th:value
  예] <input type="hidden" id="boardIdx" name="boardIdx" th:value="${board.boardIdx }">

- th:text 


- th:attrappend
  예] <td class="title">
       <a href="/board/openBoardDetail.do?boardIdx=" th:attrappend="href=${list.boardIdx}" th:text="${list.title}"></a>
 </td>
 
  

'Web > Thymeleaf' 카테고리의 다른 글

[Thymeleaf ] href 태그에 여러개의 파라미터 추가  (0) 2023.05.03