layui單元格相關(guān)操作

期望效果:

單元格樣式.png

相關(guān)代碼:

<script type="text/html" id="number">
    <div style="line-height:25px;">
        <span style="color:#328FFE">{{ d.Nownumber }}</span>
        <p style="color:#BCBBC9;margin-top:-5px;">(卡號:{{ d.Oldnumber }})</p>
    </div>
</script>
<!--時間合并-->
<script type="text/html" id="time">
    <div style="line-height:25px;">
        <span>{{ d.Day }}</span>
        <p style="color:#BCBBC9;margin-top:-5px;">{{ d.Hour }}</p>
    </div>
</script>
<script>
 layui.use('table', function () {
        var table = layui.table;
        var cols = [[
            , {field: 'Day', title: '時間', templet: '#time',align: 'center'}
            , {field: 'Number', title: '流水號', templet: '#number', width: 150,align: 'center'}
        ]];
        table.render({
            elem: '#history-basic'
            , url: '../json/history-basic.json'
            , cols: cols
            , even: true
            ,skin:"line"
            , page: true
        });
    });

</script>

代碼注釋:


1.png
2.png

對JSON數(shù)據(jù)進(jìn)行判斷

<script type="text/html" id="type">
    {{#  if(d.Type === '撤銷消費(fèi)'){ }}
    <span style="color: #FF0000;">{{ d.Type }}</span>
    {{#  } else { }}
    {{ d.Type }}
    {{#  } }}
</script>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 1、通過CocoaPods安裝項(xiàng)目名稱項(xiàng)目信息 AFNetworking網(wǎng)絡(luò)請求組件 FMDB本地?cái)?shù)據(jù)庫組件 SD...
    陽明AI閱讀 16,211評論 3 119
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,628評論 19 139
  • 數(shù)據(jù)結(jié)構(gòu)是計(jì)算機(jī)存儲、組織數(shù)據(jù)的方式。數(shù)據(jù)結(jié)構(gòu)是指相互之間存在一種或多種特定關(guān)系的數(shù)據(jù)元素的集合。通常情況下,精心...
    輕松學(xué)習(xí)C語言閱讀 531評論 0 1
  • centos系統(tǒng)下通過scrapyd部署python的scrapy 介紹 本篇記錄下我學(xué)習(xí)用scrapyd部署sc...
    JermeyPei閱讀 274評論 0 0

友情鏈接更多精彩內(nèi)容