I have looked up documentation which suggests this should be easy, yet nothing works - why do none of the style elements below get the column header to wrap? It does not wrap in classic or lightning, in preview or on a record page.

<apex:page standardController="Opportunity" extensions="ContactRolesMassEditExtension" >
        <apex:pageBlock mode="inlineEdit" >
            <apex:pageBlockButtons location="bottom">               
                <apex:commandButton action="{!save}" value="Save" id="saveButton" />                             
            <apex:pageBlockTable value="{!OCRs}" style="table-layout:fixed" var="OCR"> 
                <apex:column style="word-wrap: break-all;" headerValue="L0o0o0o0o0o 0o0o0o0o0o0o0o0o0 o0o0o0o0o0o0 o0o0o0o0o0o0o0o0 o0o0o0o0o0o0o0o0o0ng"   >
                    <apex:outputField style="word-wrap: break-word; white-space:normal" value="{!OCR.Attended_First_Meeting__c}"></apex:outputField>

2 Answers 2


Have you tried using headerClass on the <apex:column> element?

As per the docs for the style attribute:

The style used to display the column, used primarily for adding inline CSS styles. Note that this value does not apply to the header and footer cells.

  • In what way can we use “HeaderClass”?
    – number41
    Aug 2, 2021 at 15:25

None of the myriad of text wrapping related tags seemed to do anything at all - but this worked just fine:

<apex:column >
     <apex:facet name="header">Marketing<br/>Program<br/>Contact</apex:facet>
     <apex:outputField value="{!OCR.Marketing_Program_Contact__c}"></apex:outputField>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .