单一字段自动换行:
{field: 'admin_id', title: __('负责人'), operate: 'LIKE',cellStyle: {css: {"max-width": "300px","white-space":"pre-line","word-wrap":"break-word","word-break":"break-all"}}}, cellStyle: {css: {"max-width": "300px","white-space":"pre-line","word-wrap":"break-word","word-break":"break-all"}}
多个字段组合指定位置换行:
$str = ''; foreach ($json as $key2=>$value) { $str .= '商品名称:'.$value['name'].','; $str .= '购买数量:'.$value['num'].'册'.','; $str .= '商品单价:'.$value['price'].','; } $str = mb_substr($str, 0, -1); $list[$key]['order_info'] = $str;
{field: 'order_info', title: __('商品详情'), operate: 'LIKE',formatter: function (value){ var arr = value.split(','); var html = ''; $.each(arr,function(index,values){ html += values+'<br/>'; }); return html; }},
标签:word,fastadmin,中字段,换行,value,break,html,str From: https://www.cnblogs.com/lusanqian/p/16805332.html