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

remove scrollbar for an outputfield value in VF page.

Hi All,

I have a multiselect picklist value in an object . it contains around 40 values. Selected all the values. when i am reteriving the field in VF page through     <apex:outputfield value ="{!abc__c.xyz__c}" /> am getting scrol bar for this field which i dont want.
I dont want all the values needs to be display....without scrolling down.
pleae help me on this ASAP.
Hi Uday, 

The scrollbar can be shown on a visualforce page using the inline CSS Style: "overflow:auto" in an Output Panel.

And then Place your Datable inside the Output Panel.

<apex:outputPanel  layout="block" style="overflow:auto;width:750px;height:250px" >

In the above style,

width:750px - enables the Horizontal Scroll Bar
height: 250px - enables the Vertical Scroll Bar

If you only need the Horizontal Scroll Bar, the height attibute can be removed.

praveen murugesanpraveen murugesan
Hello Uday,

You use this in output field to avoid scroll bar overflow:hidden;

<apex:outputfield value ="{!abc__c.xyz__c}"  style="overflow:hidden"/>