-1

当我在表单的文本区域中输入像 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr 的值时,在回显它时,它显示为单行,有人帮助整理这个舒适的东西,它使我的桌子变形。非常欢迎您的帮助

4

2 回答 2

0

我认为您对此无能为力,除了截断字符或在 X 个字符后将其分开。我截断了...

function truncate_chars($string, $limit, $break=' ', $pad='...') {
    // return with no change if string is shorter than $limit
    if(strlen($string) <= $limit) return $string;

        $string = substr($string, 0, $limit);
        if(false !== ($breakpoint = strrpos($string, $break))) {
         $string = substr($string, 0, $breakpoint);
     }
     return $string . $pad;
}

echo truncate_chars($string);
于 2013-09-04T16:35:01.687 回答
0

word-break: break-all在大表格单元格上使用css 属性值。

http://jsfiddle.net/GgqL4/

于 2013-09-04T16:36:25.370 回答