layui table设置单行高度以展示图片

.laytable-cell-1-picurl{
height: 100%;
max-width: 100%;
}
在页面顶部,如果不加这个样式,图片会根据td高度大小显示,高度不够,图片显示不完整。
同时,记得加上

`,{field: 'picurl',
style:'height:100px;',
width : '10%',
 title: '图片', 
sort : true
 ,templet :function (p){
                 return getPicture(p.picurl);
              }
         }`
     将得到的值这样拼接前缀
  function getPicture(p){
        var str ="";
        if(p!=null&&p!=""){
            str= ""<%=fileprefix_imgs%>"+p+">";
        }
        return str;
    }  

你可能感兴趣的:(layui)