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
NatrajNatraj 

Display data in columns

Hi,

 

I have a object named 'Sample' with 2 fields. One is Name Field and the other is Value field. I need to display the data in visualforce in columns with Name field as column name and value as the values for columns.

 

All records whose name is A should display its value in column A and records whose name is B should display in column B (2 nd column) and  records with name C should display its value in column C (3 rd column ) and so on.......

 

Any ideas please............

 

 

 

Regards,

Natraj

soofsoof

Does the following work for you?

<table>
    <tr>
        <th>Column A</th>
        <th>Column B</th>
        <th>Column C</th>
    </tr>
    <tr>
        <!-- START - Column A -->
        <td>
            <table>
                <tr>
                    <apex:repeat value="{!samples}" var="sample">
                        <apex:outputPanel layout="none" rendered="{!sample.Name == 'A'}"><td>{!sample.Title__c}</td></apex:outputPanel>
                    </apex:repeat>
                </tr>
            </table>
        </td>
        <!-- END - Column A -->

        <!-- START - Column B -->
        <td>
            <table>
                <tr>
                    <apex:repeat value="{!samples}" var="sample">
                        <apex:outputPanel layout="none" rendered="{!sample.Name == 'B'}"><td>{!sample.Title__c}</td></apex:outputPanel>
                    </apex:repeat>
                </tr>
            </table>
        </td>
        <!-- END - Column B -->

        <!-- START - Column C -->
        <td>
            <table>
                <tr>
                    <apex:repeat value="{!samples}" var="sample">
                        <apex:outputPanel layout="none" rendered="{!sample.Name == 'C'}"><td>{!sample.Title__c}</td></apex:outputPanel>
                    </apex:repeat>
                </tr>
            </table>
        </td>
        <!-- END - Column C -->

    </tr>
</table>