zoukankan      html  css  js  c++  java
  • 前端layui 一列多字段的解决办法

      对layui不熟悉,然后找了个大牛帮吗处理的 留个记录

    页面添加如下样式:

    <style type="text/css">
    .layui-table-cell {
    height: auto;
    }
    </style>

    字段渲染代码如下:

    cols: [[
    {type: 'checkbox'},
    {field: 'username', align: 'center', sort: true, title: '账号'},
    {field: 'nickName', align: 'center', sort: true, title: '用户名'},
    {field: 'phone', align: 'center', sort: true, title: '手机号'},
    {field: 'sex', align: 'center', sort: true, title: '性别'},
    {field: 'createTime', sort: true, templet: function (d) {
    var returnHtml = '';
    returnHtml += 'time:' + d.createTime + '<br>';
    returnHtml += 'time1:' + d.nickName + '<br>';
    returnHtml += 'time2:' + d.username ;
    return returnHtml
    }, title: '创建时间'
    },
    {field: 'state', align: 'center', sort: true, templet: '#tplStateTbAdv', title: '状态'},
    {align: 'center', toolbar: '#tableBarTbAdv', title: '操作', minWidth: 150}
    ]]
    });

    这个align 是控制字段内容位置的

    去掉 默认就是左对齐

    center是居中,right就是右
  • 相关阅读:
    MyBatis 缓存机制
    MyBatis 动态SQL
    SpringMVC的简介与使用
    捕获组和前后查找
    正则表达式:( ) 小括号、[ ] 中括号、{ } 大括号的区别
    343.整数拆分
    74. 搜索二维矩阵
    数的划分
    213.打家劫舍||
    整数划分为k份
  • 原文地址:https://www.cnblogs.com/pboy/p/12343422.html
Copyright © 2011-2022 走看看