有没有注意这里是怎样做的?右键看看,是textarea!
有这个提示应该知道怎样做了吧

解决方案 »

  1.   

    点右键看,不是的。他们使用的是xml。但是,谢谢你的回答!
      

  2.   

    强制换行在表格里面用:<td width=* style="WORD-BREAK: break-all"> 输出写个函数吧:
    <%
    Function coder(str)
     Dim result,L,i
     If IsNull(str) Then : coder="" : Exit Function : End If
     L=Len(str) : result=""
    For i = 1 to L
      select case mid(str,i,1)
    case "<"     : result=result+"&lt;"
    case ">"     : result=result+"&gt;"
    case chr(34) : result=result+"&quot;"
    case "&"     : result=result+"&amp;"
    case chr(13) : result=result+"<br/>"
    case chr(9)  : result=result+"&nbsp; &nbsp; "
    case chr(32) : result=result+"&nbsp;"
    case else    : result=result+mid(str,i,1)
      end select
    Next
     coder=result
    End Function %>
      

  3.   

    <div style="width:300">
    如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?如何控制文本在页面中的显示格式?</div>
      

  4.   

    我叫你右键看指的是要你发现,这里用的是textarea!
      

  5.   

    To:sakura169使用textarea、iframe效果不好!
    ----------非常感谢大家的帮助! :)
      

  6.   

    可以分为两种情况处理:
    1. 用户输入时使用了回车键
       在存入数据库之前可以用nl2br函数将回车转换为<br>,这样再读取数据的时候,格式就不会错了。2. 用户输入的时候没有使用回车键
       可以使用一下方法。
       例:
         $text= wordwrap(trim($data->content),60,"\n",1);
         //$data->content 为数据库中取出来的字符串
         //trim 去掉字符串首尾的空格。
         //wordwrap 每隔60个字符就换行。wordwrap函数最后一个参数为1表示
         //换行否则就不换行
         echo(stripslashes($text));