in thymeleaf ,how could i set the comm element,if have 7 size ,each two num will have some html tag? -


i'm sorry ,my english bad,but question beset me 。 use springboot ,the engine use thymeleaf,when implement effect under code , how can each comm element (ul element) in thymeleaf?

 <div>                          <ul class="test1">                              <li>name1</li>                              <li>name2</li>                              <li>name3</li>                              <li>name4</li>                          </ul>                          <ul class="test1">                              <li>name1</li>                              <li>name2</li>                              <li>name3</li>                              <li>name4</li>                          </ul>                          <ul class="test1">                              <li>name1</li>                              <li>name2</li>                              <li>name3</li>                              <li>name4</li>                          </ul>                      </div>

i want use thymeleaf under code

   <div th:each="eachelement,elementindex:${list}">                          <th:block th:if="elementindex.index % 2 eq 0">                              <ul class="test1">                          </th:block>                                                       <li>name1</li>                              <li>name2</li>                              <li>name3</li>                              <li>name4</li>                          <th:block th:if="elementindex.index % 2 eq 0">                              </ul>                          </th:block>                      </div>

but it's wrong ? have idea solve problem?


Comments

Popular posts from this blog

Add new key value to json node in java -

javascript - Highcharts Synchronized charts with missing data points -

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -