zoukankan      html  css  js  c++  java
  • 【Thymeleaf】利用th:style设置表格行奇偶色

    设置序号:

        th:text="${status.index+1}"

    设置td的间隔色:
        th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"

    代码:

    <tbody>
        <tr th:each="reputaton,status:${rptns}">
            <tr th:each="reputaton,status:${rptns}">
            <td th:text="${status.index+1}"    th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.id}"      th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.deleted}" th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.name}"    th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.brief}"   th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.creater}" th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
            <td th:text="${reputaton.ctime}"   th:style="'background-color:'+(${status.odd}?'#fff':'#f5f2eb')"></td>
        </tr>
        </tr>
    </tbody>

    效果:

     END

  • 相关阅读:
    WP8日历(含农历)APP
    NHibernate3剖析:Mapping篇之集合映射基础(2):Bag映射
    初探springmvc
    树的子结构
    Java内存分析
    java8_api_misc
    iOS开发多线程篇 09 —NSOperation简单介绍
    CALayer1-简介
    NSCharacterSet
    iOS 音频开发
  • 原文地址:https://www.cnblogs.com/heyang78/p/15478025.html
Copyright © 2011-2022 走看看