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
saddam hussain 6saddam hussain 6 

How to display the record-1 in first column and record-2 in second column in pageblock table

User-added image
<apex:page controller="StandardAccount" >
    <apex:form >
    	<apex:pageBlock >
            <apex:pageBlockSection >
            	<apex:inputText label="AccountName" value="{!name}"/>
                <apex:commandButton value="Search" action="{!search}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockTable value="{!accs}" var="a">
    <apex:column >
            <apex:inputCheckbox/>{!a.name} <br/><br/>
            <apex:inputCheckbox/>{!a.phone}<br/><br/>
            <apex:inputCheckbox/>{!a.industry}<br/><br/>
    </apex:column>
</apex:pageBlockTable>
</apex:pageBlock> </apex:form>
</apex:page>

apex program:

public class StandardAccount {
    public List<Account> accs{set;get;}
    public string Name {set;get;}
    public StandardAccount(){
        accs=new List<Account>();
    }
    public void search(){
        accs=[select id,name,phone,industry from Account where name=:name];
    }
    public class StandardAccountwrapper {
    public List<Account> acc{set;get;}
    public StandardAccountwrapper(){
        acc=new List<Account>();
    }
}
}
pconpcon
What you currently have doesn't really make sense.  You are binding your checkboxes to anything.  If you want to have this as a two column layout, you'd want to use the apex:repeat inside of a apex:pageBlockSection with a column of 2.  Then you'd have a apex:pageBlockSectionItem that has your list of fields and checkboxes for each account.
prasanth kumarprasanth kumar
<apex:page standardcontroller="account" recordsetvar="accs">
<apex:form >

<apex:repeat value="{!accs}" var="a"> <table border="2">

<tr>
<td> {!a.name} <br/> {!a.industry} </td> </tr> </table>

</apex:repeat>


</apex:form>
</apex:page>

direct copy and paste this codeinto visualforce page and see the result.