populate a table with data from an array