The way you use the [pageBlockTable]pageBlockTable
1][1] is little confusing as I see. You have to add apex:column
tag in order to bring the columns of the table. Try below code for the table. This way you can add more columns to your table.
<apex:pageBlockTable id="sampleGrid" value="{!Contact.AccountId}" var="a">
<apex:column >
<apex:facet name="header">Account</apex:facet>
<apex:inputfield label="Account" value="{!Contact.AccountId}" />
</apex:column>
</apex:pageBlockTable>
When you use pageBlockTable, the advantage is to bind dynamic values of a list into rows by using the value
and var
attribute value. Check the documentation linked. This is not being used in the code anyway. Hope you are in a mid of a development.
[1]: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageBlockTable.htm