import collections


def build_tables(table_params, samples):
    """Construct tables from a pairing of names and row makers.
    
    Args:
        table_params: dict with file paths as keys and a function
            for creating a row of data from a sample ("row maker").
        samples: objects to iterate over and calculate the rows
    Returns:
        list of dicts where each embedded dict is a row in the table
    """
    table_data = collections.defaultdict(list)
    for sample in samples:
        for table_path, row_maker in table_params.items(): 
            table_data[table_path].append(row_maker(sample)) 
    return table_data