美文网首页
吐槽 layui table列宽无法自动分配

吐槽 layui table列宽无法自动分配

作者: vivianXIa | 来源:发表于2019-08-19 10:11 被阅读0次

看着table效果不错,文档看着也不错,但是实际查阅起来还是有点不方便,如下列宽怎样实现自动分配让我自己去猜么??猜猜也就算了,应该不设置死宽度可以自动分配。

table table code
  • 但是,这玩意,这样写列宽还是自动分配的
cols: [[
                    { field: 'id', title: '题号',}//totalRowText: '合计:'
                    , { field: 'username', title: '评分依据' }
                    , {
                        field: 'email', title: '评分标准', hide: 0, templet: function (x) {
                            return '<em>123</em>'
                        }
                    }
                    , { field: 'sex', title: '备注' }
                    , { field: 'city', title: '要求', templet: '#cityTpl1' }
                    , { field: 'sign', title: '打分' }
                    , { field: 'experience', title: '意见' }//totalRow: true
                    , { field: 'ip', title: '项目附件',}
                    , { field: 'logins', title: '是否一票否决',width:'120' , templet:''}
                ]],
自适应效果
  • 第一列添加宽度,其他代码不变
, cols: [[
                    { field: 'id', title: '题号',width:'100'}//totalRowText: '合计:'
                    , { field: 'username', title: '评分依据' }
                    , {
                        field: 'email', title: '评分标准', hide: 0, templet: function (x) {
                            return '<em>123</em>'
                        }
                    }
                    , { field: 'sex', title: '备注' }
                    , { field: 'city', title: '要求', templet: '#cityTpl1' }
                    , { field: 'sign', title: '打分' }
                    , { field: 'experience', title: '意见' }//totalRow: true
                    , { field: 'ip', title: '项目附件',}
                    , { field: 'logins', title: '是否一票否决',width:'120' , templet:''}
                ]],

宽度就无法自适应了,什么玩意????


第一列添加了宽度,无法适应

天 太垃圾了吧!!!!

相关文章

网友评论

      本文标题:吐槽 layui table列宽无法自动分配

      本文链接:https://www.haomeiwen.com/subject/ggnjsctx.html