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
Rick MacGuiganRick MacGuigan 

wrap text on apex column

How can I enforce fixed column width on a data table so that the long text labels wrap to a new line. I have some long labels that take up too much horizontall space . Their field values are short but labels are long.

Here's a sample of the visualforce datatable structure. I think the pageBlock Section is causing problems . Adding the width or even a style to the column tag doesn't have any effect.
 
<apex:pageBlockSection columns="1" id="section2c" title="Prior Year Contract Experience" showHeader="true" >
 
 
             <apex:outputPanel id="out2c">
                <apex:actionstatus startText="loading...">
                    <apex:facet name="stop" >
                        <apex:outputPanel >
                                                                                
                             <apex:dataTable value="{!PriorYRcontractSectionList}" var="pyr" rules="all" cellpadding="5"  >
                                <apex:column value="{!pyr.Name}" headerValue="Section"/>
                                <apex:column value="{!pyr.ULTIMATE_PREMIUM__c}" headerValue="Ultimate Premium"/>                                
                                <apex:column value="{!pyr.PAID_LOSS__c}" headerValue="Total Reported Loss" />
                                <apex:column value="{!pyr.ACR__c}" headerValue="Total ACRs"/>
                                <apex:column value="{!pyr.ULTIMATE_LOSS__c}" headerValue="Total Ultimate Loss"/>                                
                                <apex:column value="{!pyr.Ultimate_Loss_Ratio__c}" headerValue="Ultimate Loss Ratio"/>
                                <apex:column value="{!pyr.F_DETAIL_COMMISSION__c}" headerValue="Ultimate Commission"/>
                                <apex:column value="{!pyr.F_DETAIL_BROKERAGE__c}" headerValue="Ultimate Brokerage"/>
                                <apex:column value="{!pyr.ULT_OVERHEAD_EXCL_CATS__c}" headerValue="Ultimate Overhead (Account Overhead not Corporate)"/>
                                <apex:column value="{!pyr.ULT_CR_ACCT_OH__c}" headerValue="Ultimate C/R (incl Account Overhead)"/> 
                                <apex:column value="{!pyr.ULT_CR_ACCT_EXCL_OH__c}" headerValue="Ultimate C/R (Excl Account Overhead)"/>                                
                                <apex:column value="{!pyr.ITD_CR_EXCL_ACCT_OH__c}" headerValue="ITD C/R (Excl Account Overhead)"/>                                                               
                            </apex:dataTable>
                            
                       </apex:outputPanel>
                    </apex:facet>
                </apex:actionstatus>
            </apex:outputPanel>
 
 
 </apex:pageBlockSection>