thymeleaf dynamic mosaic class

Scene: the outbound message, to distinguish between a number of read and unread.

      <table class="layui-table">
        <thead>
        <tr>
           
            <th lay-data="{field:'details', width:'70%',align: 'left'}">
                Message content
            </th>
            <th lay-data="{field:'stata', width:'12%',align: 'center'}">
                time
            </th>
            <th lay-data="{field:'money',width:'12%',align: 'center'}">
                Message Type
            </th>
        </tr>
        </thead>
        <tbody>

        <tr th:each="bean,stat:${list}" th:classappend="${(bean.readStatus=='status/read' ? 'read ' : '') + 'pageChange'}" th:attr="data-page=@{/notification/detail(id=${bean.id})}">                       
            <td class="S224_message_detail" th:text="${bean.title}"></td>
            <td th:text="${#temporals.format(bean.createTime, 'yyyy-MM-dd HH:mm:ss', locale)}"></td>
            <td th:text="${bean.typeLabel}"></td>
        </tr>
        </tbody>
    </table>

 

 

Reference Source:

https://stackoverflow.com/questions/41480973/thymeleaf-classappend-for-multiple-classes

Guess you like

Origin www.cnblogs.com/passedbylove/p/11818364.html