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
Arek S.Arek S. 

Is it possilbe to populate a dataTable from a 2d array?

I'm wondering if it's possible to populate a dataTable from a 2d array.  For example would this work:

 

<apex:datatable value="{!DataList}" var="Data">
  <apex:column value="{!Data[0]}" headerValue="Data 1"/>
  <apex:column value="{!Data[1]}" headerValue="Data 2"/>
  <apex:column value="{!Data[2]}" headerValue="Data 3"/>
</apex:datatable>

 where DataList is defined as List<List<String>>.

 

If this isn't possible, is there another way I can convert a two dimensional array of strings into a table?

 

Thanks.