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
Scott WalkerScott Walker 

How to add custom fields for entry into a table?

Hi all,

I originally posted this in another thread but as the topic grew I thought it wise to create a new post.

So I am developing my first ever visualforce page with HTML, something i know very little about.

I have created a table with 5 columns and 13 rows and need to populate the cells with the custom fields I have created and custom formula fields for data entry.

Can anyone help me do this?  I Have the field APIs but no idea how to get rid of their field label and allow users to enter into the spaces.

The table looks like this:
User-added image


And the table code looks like this:
<table width="95%" border="1" align="center" cellpadding="1" cellspacing="1">
  <tbody>
    <tr>
      <th width="17%" height="37" scope="col">Item Number</th>
      <th width="48%" scope="col">Description</th>
      <th width="13%" scope="col">Qty.</th>
      <th width="12%" scope="col">Price Per Unit</th>
      <th width="10%" scope="col">Amount</th>
    </tr>
    <tr>
      <th scope="row">1</th>
      <td> apex:inputfield value={!Purchase_Request_Form__c.Description_of_Item_1__c}</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">4</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">5</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">6</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">7</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">8</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">9</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th scope="row">10</th>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th colspan="4" align="right" scope="row"><strong>Shipping Costs (Office will complete)</strong></th>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <th colspan="4" align="right" scope="row"><strong>TOTAL</strong></th>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>


An example of the fields are as follows:
<apex:inputfield value="{!Purchase_Request_Form__c.Description_of_Item_2__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Purchase_Request_Form__c.Description_of_Item_3__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Purchase_Request_Form__c.Description_of_Item_4__c}" required="false"/>
<apex:pageblocksectionitem />
<apex:inputfield value="{!Purchase_Request_Form__c.Description_of_Item_5__c}" required="false"/>
<apex:pageblocksectionitem />

Any help much appreciated
{VikasKhandelwal}{VikasKhandelwal}
Hi Scott,

Use ApexDataTabel instead of html.It will automatically create table for you.

You can Refer:-
http://www.salesforce.com/docs/developer/pages/Content/pages_compref_dataTable.htm

Thanks
Vikas
P.S. If this answers you question, please mark it as "Best Answer" so it will help other community members too.