+ Start a Discussion
Abhijeet Purohit01Abhijeet Purohit01 

How to increase the width of <apex:outputField> tag?

 

How to increase the width of <apex:outputField> tag?

 

I have done the following:

 

<apex:pageBlockSection>

    <apex:outputField style="width:400px;" value="{!abc.bcd__c}"/>

<apex:pageBlockSection>

 

Its not working.

 

I have included a css file also as below:

 

<apex:page  ---------------     >

<apex:form>

<style type="text/css">

.myclass { width:550px; }

</style>

-----------------

----------

--------

<apex:pageBlockSection>

    <apex:outputField styleclass="myclass" value="{!abc.bcd__c}"/>

<apex:pageBlockSection>

 

 

Its not working.

 

Can anyone help?

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
SamuelDeRyckeSamuelDeRycke

 <apex:outputField style="width:400px !important;" value="{!abc.bcd__c}"/>

 

This may do the trick.

 

I usually or use the VF components and let them handle the layout, or avoid them and do it entirely myself with html elements. If you're gonna mesh up, take into account things like scalability and maintenance.

All Answers

SamuelDeRyckeSamuelDeRycke

 <apex:outputField style="width:400px !important;" value="{!abc.bcd__c}"/>

 

This may do the trick.

 

I usually or use the VF components and let them handle the layout, or avoid them and do it entirely myself with html elements. If you're gonna mesh up, take into account things like scalability and maintenance.

This was selected as the best answer
Abhijeet Purohit01Abhijeet Purohit01

 

 I had tried it. Its not working. I forgot to tell about it.

 

Instead I have used <html> <table> and displayed using

 <apex:outputField value=" "> in a <td>

 

Thanks for your precious and timely guidance.  I am doing most of the coding just by looking at your comments. I have problem in deployment.

 

You are really TRUSTED Contributor.

 

 

Abhijeet