Skip to main content
Tweeted twitter.com/StackSalesforce/status/816665998464086016
edited tags
Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
Source Link
Nick
  • 7.2k
  • 27
  • 147
  • 286

How to wrap Rich Text Area in Visualforce

How do you wrap the text automatically? I have tried several approaches but none of them it works.

Data type for the Description field is: Rich Text Area(131072)

Visualforce page:

<apex:outputText value="{!SUBSTITUTE(description,'\n','\\\n')}"            
                      escape="false" style="white-space:pre;"/>

Controller:

 public String Description {get;set;}
 

in the controller constructor:

 myobject__c = /*soql*/
 Description = myboject__c.Description__c;

Screen shot:

enter image description here