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
ckellieckellie 

visualforce Table on one Record

I am in the scoping stage of a new visualforce page where I am wanting to create a table with 4 rows and 4 columns where each cell is an individual field on the same record. I think I will need to use html to create the table on the visualforce page, which I have not done before. Can anyone point me to an example or explain the concept of how to make the page?

 

Thank you

Shiv ShankarShiv Shankar

This might help you

 

<apex:repeat value="{! recordList}" var="rec">
<table>
	<tr>
		<td>
			<apex:outputText value="{! rec. field1}"> // output, input as your requirement
		</td>
		<td>
			<apex:outputText value="{! rec. field2}">
		</td>
		<td>
			<apex:outputText value="{! rec. field3}">
		</td>
		<td>
			<apex:outputText value="{! rec. field4}">
		</td>
	</tr>
	<tr>
		<td>
			<apex:outputText value="{! rec. field5}">
		</td>
		<td>
			<apex:outputText value="{! rec. field6}">
		</td>
		<td>
			<apex:outputText value="{! rec. field7}">
		</td>
		<td>
			<apex:outputText value="{! rec. field8}">
		</td>
	</tr>	
	<tr>
		<td>
			<apex:outputText value="{! rec. field9}">
		</td>
		<td>
			<apex:outputText value="{! rec. field10}">
		</td>
		<td>
			<apex:outputText value="{! rec. field11}">
		</td>
		<td>
			<apex:outputText value="{! rec. field12}">
		</td>
	</tr>	
	<tr>
		<td>
			<apex:outputText value="{! rec. field13}">
		</td>
		<td>
			<apex:outputText value="{! rec. field14}">
		</td>
		<td>
			<apex:outputText value="{! rec. field15}">
		</td>
		<td>
			<apex:outputText value="{! rec. field16}">
		</td>
	</tr>
</table>
</apex:repeat>

 

wajidawajida

why dont you do it like this...or did  i miss something

 

<apex:page standardController="Account">
  <apex:form >
    <apex:pageBlock > 
     <apex:pageBlockSection columns="4">
       <apex:inputField value="{!account.name}"/>
       <apex:inputField value="{!account.ownerId}"/>
       <apex:inputField value="{!account.accountsource}"/>
       <apex:inputField value="{!account.description}"/>    
         <apex:inputField value="{!account.sic}"/>
       <apex:inputField value="{!account.tickersymbol}"/>
       <apex:inputField value="{!account.website}"/>
       <apex:inputField value="{!account.phone}"/>
     </apex:pageBlockSection>
    </apex:pageBlock>    
  </apex:form>
</apex:page>