You can try something like this:
$i = 0;
$table = array();
foreach ( $array['rows'] AS $row ) {
foreach ( $array['cols'] AS $col ) {
$table['id'] = $i + 1;
$table['row'] = $row;
$table['column'] = $col;
$table['value'] = $array['name'][$i];
}
}