使用nl2br()函数来处理字段内容.

解决方案 »

  1.   

    <td style="word-break:break-all">
      

  2.   

    使用CSS中的word-break:break-all只在IE中好用,在NS中就不好用了!而且,如果你连续输入“1”这样的字符,也不会换行的!在大多数情况下,使用word-break:break-all还是好用的。建议你还是自己写一个换行的程序。
      

  3.   

    echo nl2br($str);
    or :
    $str = str_replace("\r\n", "<br>", $str);
    $str = str_replace(" ", "&nbsp;", $str);
    echo $str;