def print_table_format(headers, values):
    """Formats and prints tabular formatted data.

    headers = ['col1', 'col2']
    values  = [
        ['row1col1', 'row2col1'],
        ['row1col2', 'row2col2']
    ]

    Output:
    col1     col2
    -------- --------
    row1col1 row2col1
    row1col2 row2col2

    Args:
        headers: A list of the headers for each column.
        values: A list of lists, each list containing a column of data.
    """
    if len(headers) != len(values):
        raise Exception('Not enough headers for columns.')
    row_format = ''
    max_lens = []
    for i, v in enumerate(values):
        row_format += '{{{0}:<{{{1}}}}} '.format(i * 2, i * 2 + 1)
        v.insert(0, headers[i])
        max_len = len(max(v, key=len))
        max_lens.append(max_len)
        v.insert(1, '-' * max_len)
    row_len = len(values) + len(max_lens)
    for row_items in zip(*values):
        row = [None] * row_len
        row[::2] = row_items
        row[1::2] = max_lens
        print(row_format.format(*row))
