table2list function

Converts a table to list