+ Start a Discussion
Shrey TyagiShrey Tyagi 

Display PageBlock Table columns as separate rows

Hi Evryone ,
   I have this pretty simple code given below. Now everything works well here. What i want to do is, rather than the record being displayed as a 1 row with 3 columns. I want it to be displayed as 1 column 3 rows. Can anyone please help me with this?

Current Display Format : Name, Narrative Technical, Narrative Staffing
Desired Display Format : Name 1
                                             Narrative Technical 1
                                             Narrative Staffing 1
                                         Name 2
                                             Narrative Technical 2
                                             Narrative Staffing 2

<apex:page standardController="Project_Form__c" recordSetVar="ProjectForms">
    <apex:sectionHeader title="Form History"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />

            <apex:pageBlockSection title="Selected Project Review Forms" columns="1">
                 <apex:pageBlockTable value="{!selected}" var="form" columns="3">
                    <apex:column value="{!form.name}"/>
                    <apex:column value="{!form.Narrative_Technical__c}"/><br></br>
                    <apex:column value="{!form.Narrative_Staffing__c}"/><br></br>
                  </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Best Answer chosen by Shrey Tyagi
Balayesu ChilakalapudiBalayesu Chilakalapudi
Use <hr /> to get a line, like this,
<apex:repeat value="{!selected}" var="form" id="theRepeat">
                  <apex:outputText value="{!form.name}" id="Name"/><br />
                  <apex:outputText value="{!form.Narrative_Technical__c}" id="Technical"/><br />
                   <apex:outputText value="{!form.Narrative_Staffing__c}" id="Staffing"/><br />
                <hr />
                <hr />
</apex:repeat>

All Answers

Balayesu ChilakalapudiBalayesu Chilakalapudi
Try like this,
<apex:page standardController="Project_Form__c" recordSetVar="ProjectForms">
    <apex:sectionHeader title="Form History"/>
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockSection title="Selected Project Review Forms" columns="1">
               <apex:repeat value="{!selected}" var="form" id="theRepeat">
                  <apex:outputText value="{!form.name}" id="Name"/><br />
                  <apex:outputText value="{!form.Narrative_Technical__c}" id="Technical"/><br />
                   <apex:outputText value="{!form.Narrative_Staffing__c}" id="Staffing"/><br />
               </apex:repeat>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Shrey TyagiShrey Tyagi
Works Like a Charm!!! Thanks Bala!!!
Shrey TyagiShrey Tyagi
Is there a way I can add a line/section or some sort of a marking between the 2 reocrds here? I am looking at something like this:
Something just before closure of <apex:repeat> probably

Name 1
 Narrative Technical 1
  Narrative Staffing 1
-----------------------------------------------------------------------
-----------------------------------------------------------------------
Name 2
 Narrative Technical 2
 Narrative Staffing 2
Balayesu ChilakalapudiBalayesu Chilakalapudi
Use <hr /> to get a line, like this,
<apex:repeat value="{!selected}" var="form" id="theRepeat">
                  <apex:outputText value="{!form.name}" id="Name"/><br />
                  <apex:outputText value="{!form.Narrative_Technical__c}" id="Technical"/><br />
                   <apex:outputText value="{!form.Narrative_Staffing__c}" id="Staffing"/><br />
                <hr />
                <hr />
</apex:repeat>
This was selected as the best answer