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
Ramana123Ramana123 

how to modify the below code using page block table

<apex:page controller="ContactsVisualforceController" standardStylesheets="false"> <apex:pageBlock> <apex:repeat value="{!displayAccounts}" var="acc"> <dl> <dt>Account Name:</dt> <dd><apex:outputText value="{!acc.Name}"/></dd> </dl> <dl><dt>Contacts:</dt></dl> <apex:repeat value="{!acc.Contacts}" var="cont"> <dl> <dd><apex:outputText value="{!cont.Name}"/></dd> </dl> </apex:repeat> </apex:repeat> </apex:pageBlock> </apex:page>
Best Answer chosen by Ramana123
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi srikanth,
Try this code
<apex:page controller="ContactsVisualforceController" standardStylesheets="false">
    <apex:pageBlock>
        <apex:pageBlockTable value="{!displayAccounts}" var="acc">
            <apex:column value="{!acc.Name}"/>
            <apex:column>
                <apex:pageBlock>
                    <apex:pageBlockTable value="{!acc.Contacts}" var="cont">
                        <apex:column value="{!cont.Name}"/>
                    </apex:pageBlockTable>
                </apex:pageBlock>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

Hope this helps you
Let me know if this helps you. Kindly mark it as solved so that it may help others in future.

Thanks and Regards