CAFE

김인경

260607_과제(누적)

작성자김인경|작성시간26.06.07|조회수5 목록 댓글 0

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
  <div>
    <h4>반복문(each)</h4>
    - 지정한 횟수만큼 반복 : #numbers유틸리티의 sequence(시작, 종료) 함수 사용<br/>
    <th:block th:each="num : ${#numbers.sequence(1, 5)}">
      <span>안녕</span> / <span th:text="${num}"></span><br/>
    </th:block>
    <br/>
    <th:block th:each="num : ${#numbers.sequence(1, 10)}">
      <th:block th:with="tot = ${num * (num + 1) /2}">
        <div th:text="'1~' + ${num} + '까지의 합은?  ' + ${tot}"></div>
        tot = [[${tot}]]<br/>
      </th:block>
    </th:block>
  </div>
cs

 

다음검색
현재 게시글 추가 기능 열기

댓글

댓글 리스트
맨위로

카페 검색

카페 검색어 입력폼