I have generated my own set of data in my Visualforce controller and would like to display this as a table. I have various lists of Strings I would like to use as the columns. For example:
public List<String> dates;
public List<List<String>> columns;
public List<String> columnHeadings;
public List<String> getDates(){
List<String> theDates = new List<String>('1 Jan', '2 Jan', '3 Jan');
return theDates;
}
public List<List<String>> getColumns(){
List<List<String>> listToReturn = new List<List<String>>();
List<String> column1 = new List<String>('Cat', 'Dog', 'Rat');
listToReturn.add(column1);
List<String> column2 = new List<String>('Apple', 'Banana', 'Cherry');
listToReturn.add(column2);
return listToReturn;
}
public List<String> getColumnHeadings(){
List<String> theHeadings = new List<String>('Date', 'Animal of the Day', 'Fruit of the Day');
return theHeadings;
}
Is there a way I can put these into a Page Block Table or similar? It seems like I can only do it with object data.
Many thanks in advance for help!