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
U JayU Jay 

How can set fixed width for all columns in a apex:panelGrid in salesforce visualforce page that render as PDF

How can set fixed width for all columns in a apex:panelGrid in salesforce visualforce page that render as PDF.
Style section not worked properly when i am using renderAs="PDF" :(
Any help?
Thanks in advance.
Mikola SenykMikola Senyk
Try to use percentage width for panelGrid column. For example, if you have 5 columns set width to 20%.
To make styles section work - wrap it with <head> tag and to add applyBodyTag="false" attribute to the apex:page element.
Your page will be similar to:
<apex:page renderAs="PDF" applyBodyTag="false">
    <head>
        <style>
            .monoPg {
                width: 33%;
            }
        </style>
    </head>
    <body>
        <apex:form>
            <apex:panelGrid columns="3" columnClasses="monoPg" width="70%" border="1">
                <apex:outputLabel>111</apex:outputLabel>
                <apex:outputLabel>222</apex:outputLabel>
                <apex:outputLabel>333</apex:outputLabel>
            </apex:panelGrid>
        </apex:form>
    </body>
</apex:page>