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
crocodilecrocodile 

Unable to change the column width in a table..

Hi,

Am trying to change the column width in a table. 

Code:

 

 

<apex:page standardController="Address__c" wizard="false"
    recordSetVar="addrSet">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!addrSet}" var="a" 
            columnsWidth="10px, 10px, 10px">
            <apex:column value="{!a.name}" />
            <apex:column value="{!a.City__c}" />
            <apex:column value="{!a.Mobile__c}" />
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>
The widths are remained same even though columns widths are: 100px/1000px/1opx or not used.
Is there any other attributes i need to pass?
Thx in adv,
VNath

 

shra1_devshra1_dev

change the column width in <apex:column/> tag

 

ex:

<apex:column width="100px"/>

 

 

 

Regards,

 

Shravan

crocodilecrocodile

Thanks Shravan for the reply.

 

The table has 3 columns. when i applied width attribute for 2 columns: Working

but when applied for all the columns : not working.

 

working code: 

 

<apex:column value="{!a.name}" width="50px"/>
<apex:column value="{!a.City__c}" width="60px"/>
<apex:column value="{!a.Mobile__c}"/>
Not working code:
<apex:column value="{!a.name}" width="50px"/>
<apex:column value="{!a.City__c}" width="60px"/>
<apex:column value="{!a.Mobile__c}" width="10px"/>
is there anything wrong in the second code..?
Thx,
VNath

 

crocodilecrocodile

Got. 

If the page rendering format is html and when we apply width for all columns it is not working. But if the rendering is html: works.

 

Thx,

VNath

sreenathsreenath

Hi guys,

              i need help regarding pageblock table column width must be fixed. It changes automatic by the values in the table

 

 

Thanks,

sreenath

crocodilecrocodile

Hi Sreenath,

Use width="100px" attribute in the <apex: column> tag.

ex:

<apex:column value="value" width="size in px">

 

Thx,

VNath