As others have comment what you are asking is not entirely clear. Here are two things you might be asking about...
Lookup fields are presently tied to a specific SObject type. So if you want an SObject to have lookup fields to several SObject types you will have to add multiple lookup fields.
If only one of them is ever populated, with controller code like this:
public with sharing MyController {
....
public CustomObject__c sob {get; private set;}
public String[] lookupFields {
get {
return new String [] {'A__c', 'B__c', 'C__c', 'D__c'};
}
}
}
the page can just present the populated field like this:
<apex:repeat values="{!lookupFields}" var="f">
<apex:inputField value="{!sob[f]}" rendered="{!sob[f] != null}"
</apex:repeat>
The same technique - using field name strings - can be used to present a set of table columns dynamically:
public with sharing MyController {
....
public CustomObject__c[] sobs {get; private set;}
public String[] columns {
get {
return new String [] {'A__c', 'B__c', 'C__c', 'D__c'};
}
}
}
with the page containing this:
<apex:pageBlockTable value="{!sobs}" var="sob" >
<apex:repeat value="{!columns}" var="c">
<apex:column value="{!sob[c]}"/>
</apex:repeat>
</apex:pageBlockTable>
PS
Here is a fairly complicated example of conditionally rendering different columns depending on the field name:
<apex:repeat var="f" value="{!fields}">
<apex:column rendered="{! f == 'Name'}">
<apex:facet name="header">Return To Work Name</apex:facet>
<apex:outputLink value="/{!item.Id}?saveURL={!currentPageUrl}">
{!item.Name}
</apex:outputLink>
</apex:column>
<apex:column rendered="{! f != 'Id' && f != 'Name' && f != 'Attachments__c' && f != 'Earnings__c'
&& f != 'EarningsPerWeek__c' && f != 'EarningsPerMonth__c'}" value="{!item[f]}"/>
<apex:column rendered="{! f == 'Earnings__c'}" value="{!item.Earnings__c}" headerClass="textalignright" styleClass="textalignright" />
<apex:column rendered="{! f == 'EarningsPerWeek__c'}" value="{!item.EarningsPerWeek__c}" headerClass="textalignright" styleClass="textalignright"/>
<apex:column rendered="{! f == 'EarningsPerMonth__c'}" value="{!item.EarningsPerMonth__c}" headerClass="textalignright" styleClass="textalignright"/>
<apex:column rendered="{! f == 'Attachments__c'}" value="{!item.Attachments__c}" headerClass="textalignright" styleClass="textalignright"/>
</apex:repeat>
OwnerId
can point to User or Queue, Activity'sWhatId
can point to Account or some custom objects? Or is your question about something very specific in a visualforce page you're struggling with? If you want to show all fields on an object in repeat or pageblocktable you should read about "dynamic apex", "describe" operations and maybe fieldsets... What are you trying to achieve?