prepare_table function

Split up a table by rows