1

I am using a apex repeat which is giving me details as below

data1

data2

data3

data4

I want to display it as

<table>
<tr><td>data1</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data2</td></tr><br/>
<tr><td>data3</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data4</td></tr>
</html>

and so on..

Can any help me on this???

Thanks in advance !!!

0

2 Answers 2

3

This should be fairly easy to achieve. Try something like this.

<apex:pageBlock>
<apex:pageBlockSection>
<apex:repeat value="{!myWrapperList}" var="obj">
    <apex:pageBlockSectionItem>
        {!obj.a.id}
        {!obj.a.name}
        {!obj.a.BillingCity}
    </apex:pageBlockSectionItem>
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>

The default number of columns for PageBlockSection is 2. If you want to change that add the columns attribute in pageBlockSection

1
  • apex:panelGrid is designed for this situation in mind. It will dynamically make a table of the specified columns using the elements within.
    – sfdcfox
    Aug 28, 2014 at 14:16
0

Use pageBlock with columns as 2, and do repeat.. it works :)

2
  • apex:pageBlockSection ... sorry Aug 28, 2014 at 11:00
  • Not a realy correct answer. He wants to have two different records in one column. Aug 28, 2014 at 11:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .