有2种解决方法 1.使用css来设置td或者div增加下面的样式 white-space:pre-wrap; 2.使用php来提前处理数据 $list[$k]['cnt'] = nl2br($v['cnt']);