Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a pageblocktable in Vf page where accounts records are rendered. I have Zip code as Child object for Account object .

Now I want to show the relatedlist in that Vf page where the related list are shown

What is the best layout and wayout to do this.??

share|improve this question
Note--The relatedlist that I want to show is in pageblocktable.. – Arun SFDC Jan 29 '13 at 9:55


List<Account> acc { get; set; }

public YourClass()
    acc = [ Select Id, Name, (Select Id, Name From ZipCodes__r) From Account ];


<apex:pageBlockTable value="{!acc}" var="a">
    <apex:column value="{!}"/>
    <apex:column value="{!}"/>
    <apex:column breakBefore="true" colspan="2" style="background:#eee;">
        <b>Related ZIP codes: </b>
        <apex:repeat value="{!a.ZipCodes__r}" var="z">
share|improve this answer

We can't tell you what layout is the best ;) One option would be to have 2 columns and use the standard tag for the related list:

<apex:pageBlockTable value="{!accounts}" var="a">
    <apex:column value="{!a.Name}" />
    <apex:column headerValue="ZIP Codes">
        <apex:relatedList subject="{!a.Id}" list="ZIP_Codes__r" />

You can style it a bit, for example to remove the header images from the list use the title attribute... Or if you want - embed another pageblocktable, repeat tag etc and have full control over the styling.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.