+ 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:pageBlock >
<apex:pageBlockTable value="{!accs}" var="a">
    <apex:column >
            <apex:inputCheckbox/>{!a.name} <br/><br/>
</apex:pageBlock> </apex:form>

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>();
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">

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



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