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
RAMANJINEYULU GOGULARAMANJINEYULU GOGULA 

how to put wrapper class(multiple object) fields side by side

I want to keep 4 coloumns as  Name, PhoneNumber, OrderName(oName), PaymentAmount.
Controller:

public class multiwrapper 
{
    public class multiInfo
    {
        public String Name    {get;set;}
        public String phNum   {get;set;}
        public String oName   {get;set;}
        public Decimal payment{get;set;}
    }
    public List<multiInfo> aldata{get;set;}
    public multiwrapper()
    {
        aldata = new List<multiInfo>();
        multiInfo mi;
        for(PersonInfo__c pi:[SELECT Name,Phone_Number__c FROM PersonInfo__c])
        {
            mi=new multiInfo();
            mi.Name    = pi.Name;
            mi.phNum   = pi.Phone_Number__c;
            aldata.add(mi);
        }
        for(Order__c oc:[SELECT Name,Payment_Amount__c FROM Order__c])
        {
            mi=new multiInfo();
            mi.oName   = oc.Name;
            mi.payment = oc.Payment_Amount__c;
            aldata.add(mi);
        }
    }
}


VF Page:

<apex:page sidebar="false" controller="multiwrapper" standardStylesheets="false">
<style>
h1
{
    background-color:pink;font-size:44px;font-family:Mistral;
}
</style>
<center>
    <h1>Multi-Object Wrapper</h1>
</center>
<table>
    <tr>
        <th>Name</th>
        <th>Phone Number</th>
        <th>Order Name</th>
        <th>Payment Amount</th>
    </tr>
    <apex:repeat value="{!aldata}" var="dat">
    <tr>
        <td><apex:outputText value="{!dat.Name}"></apex:outputText></td>
        <td><apex:outputText value="{!dat.phNum}"></apex:outputText></td>
        <td><apex:outputText value=" {!dat.oName}"></apex:outputText></td>
        <td><apex:outputText value=" {!dat.payment}"></apex:outputText></td>
    </tr>
    </apex:repeat>
</table>
</apex:page>
SandhyaSandhya (Salesforce Developers)