Controller First…
public with sharing class locationController{
public list<location__c> locationList{get;set;}
public locationController(){
locationList = [Select ID, Country__c, State__c, City__c
From Location__c];
}
}
Visualforce Page Second…
<apex:page controller="locationController">
Location Table
<apex:messages style="color:red"></apex:messages>
<apex:form>
<apex:pageblock>
<apex:pageblocktable value="{!locationList}" var="locItem">
<apex:column headervalue="Country">
<apex:inputfield value="{!locItem.Country__c}">
</apex:inputfield>
</apex:column>
<apex:column headervalue="State/Province">
<apex:inputfield value="{!locItem.State__c}">
</apex:inputfield>
</apex:column>
<apex:column headervalue="City">
<apex:inputfield value="{!locItem.City__c}">
</apex:inputfield>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>