You need to sign in to do that
Don't have an account?
ranjith kumar
how decrease the width of picklist field?
By default picklist will display values with width 5. But i want to decrease the width of that field.
I am entering numbers from 1 to 20 in picklist field. The picklist field width should be 2 only so that the values will fit into the field. How to achieve this one
Thanks in advance....Regards
-----------------------------------------
Ranjith
Hi,
You can specify the width of the picklist in the style attribute.
Try the below code snippet as reference:
<apex:page >
<apex:form >
<apex:selectList size="1" style="width:40px;">
<apex:selectOption itemLabel="1" itemValue="1"></apex:selectOption>
<apex:selectOption itemLabel="2" itemValue="2"></apex:selectOption>
<apex:selectOption itemLabel="3" itemValue="3"></apex:selectOption>
<apex:selectOption itemLabel="4" itemValue="4"></apex:selectOption>
<apex:selectOption itemLabel="5" itemValue="5"></apex:selectOption>
<apex:selectOption itemLabel="6" itemValue="6"></apex:selectOption>
<apex:selectOption itemLabel="7" itemValue="7"></apex:selectOption>
</apex:selectList><p/>
</apex:form>
</apex:page>
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
<!-- not working: -->
<apex:inputField label="" value="{!Custom_Object__c.Custom_Field__c}" style="width: 4\0px">