You need to sign in to do that
Don't have an account?

how to split the field value in the table in the visualforce page
Hello all
i am new to the vf, i am trying to populate the field values in a table format for the custom object, (i have not used Custom controllers)
how do i populate the field values in 2 columns like shown in the snapshot
below is my code
<apex:page standardController="Apartment__c" showHeader="false" renderAs="pdf" DocType="html">
<apex:form >
<apex:pageBlock title="Appartment Details">
<apex:pageBlockSection >
<table style="width:100%">
<tr>
<td> <apex:outputField value="{! Apartment__c.Name }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Floor_No__c }"/> </td>
<td> <apex:outputField value="{! Apartment__c.Phase__c }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Property_No__c }"/> </td>
<td> <apex:outputField value="{! Apartment__c.Facing__c }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Terrace_Area_Cost__c }"/> </td>
</tr>
</table>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

i am new to the vf, i am trying to populate the field values in a table format for the custom object, (i have not used Custom controllers)
how do i populate the field values in 2 columns like shown in the snapshot
below is my code
<apex:page standardController="Apartment__c" showHeader="false" renderAs="pdf" DocType="html">
<apex:form >
<apex:pageBlock title="Appartment Details">
<apex:pageBlockSection >
<table style="width:100%">
<tr>
<td> <apex:outputField value="{! Apartment__c.Name }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Floor_No__c }"/> </td>
<td> <apex:outputField value="{! Apartment__c.Phase__c }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Property_No__c }"/> </td>
<td> <apex:outputField value="{! Apartment__c.Facing__c }" /> </td>
<td> <apex:outputField value="{! Apartment__c.Terrace_Area_Cost__c }"/> </td>
</tr>
</table>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
You can use the below code:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Ajay Dubedi
www.ajaydubedi.com
Try this code, it will show the data in table format.
I suggest to visit this link, it will help you
https://developer.salesforce.com/forums/?id=906F0000000DEPAIA4
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Error: <apex:pageBlockSectionItem> may have no more than 2 child components"
below is my code without the table
<apex:page standardController="Apartment__c" showHeader="false" renderAs="pdf" DocType="html" standardStylesheets="false"> <head> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } </style> </head> <apex:form > <apex:pageBlock> <apex:pageBlockSection> <table style="width: 100%;"> <tr> <td style="width: 50%;"> <table> <tr> <td> <apex:outputField value="{! Apartment__c.Name }" /> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Floor_No__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Phase__c }" /> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Property_No__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Facing__c }" /> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Terrace_Area_Cost__c }"/> </td> </tr> </table> </td> <td style="width: 50%;"> <table style="width:100%"> <tr> <td> <apex:outputField value="{! Apartment__c.Appox_Amount__c }" /> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Basic_Rate_Per_Sqft__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.SFT__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Floor_Rise_Charges_Per_Sqft__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Total_Rate__c }"/> </td> </tr> <tr> <td> <apex:outputField value="{! Apartment__c.Layout__c }"/> </td> </tr> </table> </td> </tr> </table> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>