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
iSfdciSfdc 

Column width changing in VF

Hi,

I have created a table in VF page(rendered as PDF),  where it displays certain records with header info.

I am not able to fix the length of the Column in a static manner.

 

<apex:column width="200px">

<apex:facet name="header"><b>{!$ObjectType.account.fields.Customer_Rating__c.label}</b></apex:facet>

<apex:outputText value="{!accounts.Customer_Rating__c }" styleClass="title"/>

</apex:column> 

 

Here even if I mention the width as 200px, the header should be limited to 200 only and not being increased since the retrieved label is more than 200.

If the retrieved header is more than 200, it should display in the next line. 

Any kind of pointers would really help me.

 

Thanks 

TehNrdTehNrd

Try:

 

 

<apex:column style="width: 200px">

 

 

 

Chief__cChief__c

<apex:column>

<div style="width: 200px">

<apex:facet name="header"><b>{!$ObjectType.account.fields.Customer_Rating__c.label}</b></apex:facet>

<apex:smileysurprised:utputText value="{!accounts.Customer_Rating__c }" styleClass="title"/>

</div>

</apex:column> 

 

This is how I'd do it.