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
SimrinSimrin 

Fixing table width or column width

test
<apex:pageBlock >         
                <apex:repeat value="{!pList}" var="x">                  
                    <apex:pageBlockSection title="{!x}" columns="1"  >
                        <apex:repeat value="{!pList[x]}" var="y">
                            <apex:pageBlockSection title="{!y}" columns="8" >
                                <apex:repeat value="{!pList[x][y]}" var="z">
                                    <apex:dataTable value="{!pList[x][y][z]}" var="z" border="1"  width="12.5%"  >
					 <apex:column>
					 1
                                        </apex:column>
					 <apex:column>
					 2
                                        </apex:column>   
                                    </apex:dataTable>
                                </apex:repeat>                                      
                            </apex:pageBlockSection>
                        </apex:repeat>
                    </apex:pageBlockSection>
                </apex:repeat>
            </apex:pageBlock>

I have a above snippet, which tries to display blocks in manner in second diagram but it displays in manner in first diagram.

Is there way i can fix the table width.
 

Best Answer chosen by Simrin
SaranshSaransh
You can fix the column size : 
<apex:column width=""/>

All Answers

SaranshSaransh
You can fix the column size : 
<apex:column width=""/>
This was selected as the best answer
SimrinSimrin
If i set apex:column width="100%" or apex:column width="12.5%",i stil have same result, floating cubes
SaranshSaransh
Do not use "%" instead use fix size in "px"
SimrinSimrin

well, i have already tried px.

I alslo tried, columnsWidth in dataTable.  But all time its samme result.

SaranshSaransh
Try something like this :
 
<style>
.test{
width:100px;
}
</style>
<apex:pageBlock >
<apex:dataTable value="{!1}" var="a" border="1">
<apex:column width="100px" styleClass="test" value="{!1}"/>
</apex:dataTable>
<apex:pageBlock>

 
SaranshSaransh
If possible for you, then provide me your whole code and I will make it work because guessing like this doesn't help you a lot.
SimrinSimrin

Thank you very much Saransh.  I cant paste code  here, unfortunately.