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
zen_njzen_nj 

visualfrorce pageblock title automatically wrap around after 47 characters

Hi

Is there a way to format or set up a visualforce pageBlock so that the text of my title (which happens to be pretty long) can be better formatted, especially alongside the Save and Cancel buttons>

Specifically, I  have the following section of code:

<apex:pageBlock title="A very long title since it really is more like a help text to let people know what will be happening next and as such it will wrap around on the screen somehow... and so on and so on ...">
<apex:pageBlockButtons>
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:PageBlockButtons>
.
.
</apex:PageBlock>


And so what's appearing on screen is something like this:


A very long title since it really is more like a help text
to let people know what will be happening next and                 <Save button> <Cancel button>
as such it will wrap around on the screen somehow.
... and so on and so on ...

And what I really would like to have been displayed would be really having the title text wrap only after it's gone thru the whole width of the page and so would be more like:

A very long title since it really is more like a help text to let people know what will be happening next and as such it will wrap around on the screen somehow... and so on and son on  ...

                                                           <Save button>  <Cancel button>
JimRaeJimRae
what if you made your long title a component, or just inserted the text in an empty pageblock above your block, or in a pageblocksection at the top of that element?
MATTYBMEMATTYBME
How about:

Code:
<apex:page>
<apex:form>
<apex:pageBlock>
<b>
A very long title since it really is more like a help text to let people know what will be happening next and as such it will wrap around on the screen somehow... and so on and son on  ...
</b>
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!Save}" value="Save"/>
<apex:commandButton action="{!Cancel}" value="Cancel"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

Does exactly what you want.

zen_njzen_nj
Thx JimRae and Mattybme - that is exactly what I was looking for!
And a special thx to Mattybme for providing sample code to make it easier!