layui table 列宽百分比显示
Posted luo1240465012
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了layui table 列宽百分比显示相关的知识,希望对你有一定的参考价值。
var layer = layui.layer, form = layui.form, table = layui.table; var $ = layui.$; /*select gysmc,zyzw ,xm ,sjhm ,bgshm ,emilyx , zgsrgzwsj ,zggsgl ,cast(gysxxid as int) as gysxxid, pc, gysryxxMdataID as ID,sjbs from gysryxxMdata*/ var tableInit = table.render( elem: ‘#tbgysplay‘ , method: ‘post‘ , data: jsonData , height: "auto" , id: "tbgysplay" , text: none: ‘暂无相关数据‘ , toolbar: "#toolbarplan" , cols: [[ type: "checkbox", fixed: "left", width: 50 , field: "number", title: "序号", width: ‘5%‘, align: "left", templet: function (data) return data.LAY_INDEX , field: "ID", title: "ID", align: "left", hide: true , field: "action", title: "action", align: "left", hide: true , field: "sjbs", title: "sjbs", align: "left", hide: true , field: "供应商名称", title: "供应商名称", width: ‘20%‘, align: "left" , field: "主要产品类型", title: "主要产品类型", width: ‘20%‘, align: ‘left‘ , field: "所在省份", title: "所在省份", width: ‘15%‘, align: ‘left‘ , field: "PSA计划时间", title: "PSA计划时间", width: ‘20%‘, align: ‘left‘, edit: ‘select‘, templet: function (d) return ‘<input type="text" name="rzrq" verify lay-verify="verify" value="‘ + (d.rzrq || ‘‘) + ‘" placeholder="请选择时间" readonly="readonly" class="layui-input layui-input-date" style="text-align: center"/>‘; , field: "PSA计划负责人", title: "PSA计划负责人", width: ‘20%‘, align: ‘left‘, edit: ‘text‘ ]] , done: function () //当数据渲染完后,执行的回调 //日期控件 $(".layui-input-date").each(function (i) layui.laydate.render( elem: this, format: "yyyy-MM-dd", done: function (value, date) if (res && res.data[i]) $.extend(res.data[i], ‘rzrq‘: value) ); ); layer.closeAll(); ); //双击编辑行 table.on(‘edit(tbgysplay)‘, function (obj) //检验格式 电话 办公室电话 邮箱 );
以上是关于layui table 列宽百分比显示的主要内容,如果未能解决你的问题,请参考以下文章
bootstrap table 表格太宽,设置的width属性不起作用怎么办