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
TehNrdTehNrd 

panelGrid columns don't maintain equal width

What I want to accomplish is two pageBlocks next to each other that maintain the same size regardless of screen size. Below is the code that is causing issues. It seems that the title attribute of the pageBlock is causeing the pageBlock size to change. If you remove the titles the blocks are perfectly even.

I'm pretty new at this so if there is a better way to have to page blocks next to each other I'm all ears.


Code:
<apex:page>
        <apex:panelGrid columns="2" id="theGrid" width="100%">
                <apex:pageBlock title='Big Long Ugly Title #!$!#'>
                </apex:pageBlock>
                
                <apex:pageBlock title='Small'>
                </apex:pageBlock>
        </apex:panelGrid>
</apex:page>

 

aballardaballard
I think you can achieve what you want by defining a style class that specifies width:50% and then using this for the columnClasses attribute of the panelGrid.  e.g., something like
 
<style>
   .colstyle {width:50%}
</style>
<apex:panelGrid columns="2" id="theGrid" width="100%" columnClasses="colstyle">

 
TehNrdTehNrd
That did the trick. Thank you much!
rpp0910rpp0910

Hi ,

 

  When data is entered into the column , the column width is dynamically altered -doesnt stay the same as width specified.

 

Is there a way out to avoid dynamically altering column width inside panel grid. column width is specified as your example.

 

 

rahul kumar(mumbai)rahul kumar(mumbai)

Thanks a lot ......

))))))