def get_print_format(records):
    """Find the best format to display the given list of records in table format"""
    if not records:
        raise ValueError('missing parameter records')

    if not isinstance(records, list):
        raise ValueError('records is not a list')

    size = len(records[0])
    max_len = [0] * size

    col_index = list(range(size))
    for rec in records:
        if len(rec) != size:
            raise ValueError('size of elements in the records set are not equal')

        for i in col_index:
            max_len[i] = max(max_len[i], len(str(rec[i])))

    recommend_format = ''
    for each in max_len:
        recommend_format += '{:' + str(each + 2) + '}'

    return recommend_format, max_len