function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SabrentSabrent 

whitespace in <apex: outputText>

I want to include a space after Documents.   (Steps1-4 msut be...)

what do I need to do to the Style to put a white space in the string?

 

 

<apex:outputText style="font-size:9pt;font-weight:bold!important;" value="tab to Preview Required Insurance Coverages and Upload Insurance Related Documents.(Steps 1 - 4 must be completed on this tab when uploading documents) " />

 

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
sfdcfoxsfdcfox

You can use &nbsp; to insert a non-breaking space, or you can use "white-space: pre" to preserve white space.

All Answers

Edwin VijayEdwin Vijay

Does just adding the whitespace in the value does not work? Like this

 

<apex:outputText style="font-size:9pt;font-weight:bold!important;" value="tab to Preview Required Insurance Coverages and Upload Insurance Related Documents. (Steps 1 - 4 must be completed on this tab when uploading documents) " />

 Else, you can split up the outputtext into two parts, the first one upto "Documents." and the other part the remaining one. And then, add 

&nbsp;

 inbetween the two.

sfdcfoxsfdcfox

You can use &nbsp; to insert a non-breaking space, or you can use "white-space: pre" to preserve white space.

This was selected as the best answer
SabrentSabrent

Thanks!!!

 

white-space: pre did the trick. &nbsp displays the ASCII code (160)

 

<apex:outputText style="font-size:9pt;font-weight:bold!important;white-space:pre-wrap;" value=" (Steps 1 - 4 must be completed on this tab when uploading documents)" />

 

 

devisfundevisfun

I'm not sure if it's the new version, but this doesn't seem to work.  The &nbsp; method will work if you add the escape attribute:

 

<apex:outputText style="font-size:9pt;font-weight:bold!important;" value="tab to Preview Required Insurance Coverages and Upload Insurance Related Documents.(Steps 1 - 4 must be completed on this tab when uploading documents)&nbsp;" escape="false" />