I created a html body in controller class of Visualforce page and want to show that table on vf page. To make that happen i used <apex:inputTextArea label="RichText" styleClass="slds-select" value="{!htmlBody}" richText="true" cols="50" rows="15" />

but when i do that in vf page it showing attributes of html also.

enter image description here


The simplest way to display/edit a rich text field in Visualforce is to use an apex:inputField on an SObject field of type "Text Area (Rich)". Then the platform supplies the required formatting logic including some basic editing buttons. (You can add such a field to any of your custom objects and expose the field from your controller: klunky but sometimes the simplest way to go given that so much of the built-in functionality is tied to fields.)

The CKEditor approach that Tushar mentions is an alternative, but you need to have OK JavaScript skills to use that. (We use both the field and CKEditor approaches in our code base.) CKEditor lets you offer a lot more editing options but beware of trying to do that if your tag means you are trying to edit Content Notes as those only accept very limited HTML.

  • No not working after so many approach. Is there any other way to do the same.? – Radhe Jan 24 '19 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.