Skip to content

基数-偶数-first-last 控制

html
<th:block th:each="item,stat:${importantlServicesList}">
  <div
    th:class="${stat.odd ? 'views-row-odd' : 'views-row-even'}"
    th:classappend="(${stat.first ? 'views-row-first' : ''}) + (${stat.last ? 'views-row-last' : ''})"
  >
    <a th:href="${item.article.pcUrl}" target="_blank">
      <h3 th:text="${item.listTitle}"></h3>
    </a>
  </div>
</th:block>