html table font,font-table.html

layui-soul-table

诗词

class="layui-input" placeholder="请输入诗词关键字">

内容

class="layui-input" placeholder="请选择内容关键词">

查询

导出

编辑

删除

// 自定义模块

layui.config({

base: 'ext/', // 模块目录

version: 'v1.5.16'

}).extend({ // 模块别名

soulTable: 'soulTable'

});

layui.use(['form', 'table','soulTable'], function () {

var table = layui.table,

soulTable = layui.soulTable,

form = layui.form,

$ = layui.$;

var myTable = table.render({

elem: '#myTable'

,url: 'data.json'

,height: $(document).height() - $('#myTable').offset().top - 20

,totalRow: true

,page: false

,cols: [[

{type: 'checkbox', fixed: 'left'},

{field: 'title', title: '诗词', width: 165 , fixed:'left', totalRowText: '合计', sort: true, filter: true},

{field: 'dynasty', title: '朝代', width: 165 , sort: true, filter: true, excel:function (d) {

var colors = {'清代':'01AAED', '唐代':'FFB800', '宋代':'FF5722','明代':'5FB878'};

return {

color: colors[d.dynasty]?'FFFFFF':'000000',

bgColor: colors[d.dynasty]

}

}},

{field: 'author', title: '作者', width: 165 , filter: true},

{field: 'type', title: '类型', width: 112, filter: {split:','}, sort:true},

{field: 'content', title: '内容', width: 823, filter: true},

{field: 'heat', title: '点赞数', width: 112, totalRow: true, filter: true, sort:true, excel:{cellType: 'n'}},

{field: 'createTime', title: '录入时间', width: 165, filter: {type: 'date[yyyy-MM-dd HH:mm:ss]'}, sort:true, excel:{cellType: 'd'}},

{title: '操作', width: 156, fixed: 'right', templet: '#bar'}

]]

,done: function () {

soulTable.render(this)

}

});

form.on('submit(search)', function (data) {

myTable.reload({

where: data.field

})

})

form.on('submit(export)', function () {

soulTable.export(myTable);

})

})

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值