You need to sign in to do that
Don't have an account?

How to change the column width
Hi
I'm trying to increase the width of the columns but am not able to make it happen.
I tried both width on the pageBlockTable and on the column but nothing works.
What am I doing wrong?
<apex:pageBlockSection title="Pending Orders"> <apex:form > <apex:pageBlockTable width="80%" value="{!mySearchResults}" var="entry"> <apex:column headerValue="Select"> <apex:inputCheckbox id="checkedone" value="{!entry.isSelected}"/> <apex:actionSupport event="onclick" /> </apex:column> <apex:column value="{!entry.libTitle.Type__c}" headerValue="Type"/> <apex:column width="500px" value="{!entry.libTitle.Name}" headerValue="Name"/> <apex:column value="{!entry.authors}" headerValue="Autors"/> <apex:column width="5000px" value="{!entry.libTitle.Abstract__c}" headerValue="Abstract"/> <apex:column value="{!entry.libTitle.Publication__c}" headerValue="Publication"/> <apex:column value="{!entry.libTitle.Publish_Date__c}" headerValue="Publish Date"/> </apex:pageBlockTable> </apex:form> </apex:pageBlockSection> </apex:pageBlock>
Thanks
Its because the pageblocktable is nested in a pageblocksection. If you make it a child of a pageblock, the widths are honoured. It seems to be that when its inside a pageblocksection the table headers are a fixed size that can't be influenced by the columns.
This worked for me:
All Answers
Have you tried specifying the width via an inline style? I've used in the past with success:
This does not do the trick either...
Any idea why these do not work?
They do work in my dev org - I don't know why they wouldn't work in your case.
Have you tried inspecting the source to see if the width is making it through correctly?
No, I'm not sure how to do that...
Hi
If this is what you meant then it seems it was populated
I meant to look at the HTML elements that were rendered. If you are using chrome you can inspect the elements on the HTML page to see what the properties are. It will also show if your width has been overridden by another style etc.
It seems it has propogated to the HTML but still doesn't affect the page.
Help needed
Its because the pageblocktable is nested in a pageblocksection. If you make it a child of a pageblock, the widths are honoured. It seems to be that when its inside a pageblocksection the table headers are a fixed size that can't be influenced by the columns.
This worked for me:
Thanks, You are right.
So disappointing I really liked the pageblocksection look & feel
Another option is using the apex:dataTable but then the table needs to be styled
If you set your columns=1 on the page block section and use the columnswidth on the pageblock table, the table will honor the widths.
Psudeo Code:
Edit: Ok so it won't totally honor the widths as it will make the pageblock table fill up the width of the screen.
Yes the above suggestion works well...
<apex:pageblock>
<apex:pageblocksection columns="1">
<apex:pageblocktable columnswidth="250px,250px">
.........
........
</apex:pageblocktable>
</apex:pageblocksection>
</apex:pageblock>
Thanks bob_buzzard
<apex:page standardController="Account_Plan__c" tabStyle="Account_Plan__c" extensions="Cntrl_AccountPlan" title="" >
<apex:form >
<apex:pageBlock>
<apex:pageBlockSection title="ACCOUNT PLAN DETAIL" columns="1">
<apex:outputField value="{!accountPlan.Name}" />
<apex:outputField value="{!accountPlan.Year__c}"/>
<apex:outputField value="{!accountPlan.Account__c}" />
<apex:outputField value="{!Account_Plan__c.OwnerId}" label="Account Plan Owner" />
<apex:outputField value="{!accountPlan.Key_Brands__c}"/>
<apex:outputField value="{!accountPlan.Key_Client_Agency_Contacts__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="ACCOUNT ANALYSIS" columns="1">
<apex:outputField value="{!accountPlan.Last_Year_s_Successes__c}"/>
<apex:outputField value="{!accountPlan.Last_Year_s_Challenges__c}"/>
<apex:outputField value="{!accountPlan.This_Year_s_Opportunities__c}"/>
<apex:outputField value="{!accountPlan.Product_Asks__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="ACCOUNT REVENUE" columns="1">
<apex:pageBlockTable value="{!null}" var="d" columnsWidth="20%,20%,20%,20%,20%">
<apex:column><apex:outputField value="{!accountPlan.Last_Year_s_Revenue_Q1__c}" /><apex:outputField value="{!accountPlan.This_Year_s_Plan_Q1__c}"/><apex:outputField value="{!accountPlan.This_Year_s_Actuals_Q1__c}"/> </apex:column>
<apex:column><apex:outputField value="{!accountPlan.Last_Year_s_Revenue_Q1__c}" /><apex:outputField value="{!accountPlan.This_Year_s_Plan_Q1__c}"/><apex:outputField value="{!accountPlan.This_Year_s_Actuals_Q1__c}"/> </apex:column>
<apex:column><apex:outputField value="{!accountPlan.Last_Year_s_Revenue_Q1__c}" /><apex:outputField value="{!accountPlan.This_Year_s_Plan_Q1__c}"/><apex:outputField value="{!accountPlan.This_Year_s_Actuals_Q1__c}"/> </apex:column>
<apex:column><apex:outputField value="{!accountPlan.Last_Year_s_Revenue_Q1__c}" /><apex:outputField value="{!accountPlan.This_Year_s_Plan_Q1__c}"/><apex:outputField value="{!accountPlan.This_Year_s_Actuals_Q1__c}"/> </apex:column>
<apex:column><apex:outputField value="{!accountPlan.Last_Year_s_Revenue_Q1__c}" /><apex:outputField value="{!accountPlan.This_Year_s_Plan_Q1__c}"/><apex:outputField value="{!accountPlan.This_Year_s_Actuals_Q1__c}"/> </apex:column>
</apex:pageBlockTable>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!Edit}" value="Edit"/>
<apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};"/>
<input value="Clone" onclick="navigateToUrl('/apex/AccountPlan?clone=1&id={!Account_Plan__c.id}')" type="button" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
In my Account Revenue section i have 5 columns. to adjust the column width i am using page block table. But nothing is getting displayed under ACCONT REVENUE. Please guide.