def print_table(tablelist):
    """
    neatly print a table to the terminal

    Note: finds out the maximun length of each column then adds whitespace
          padding to each of the fields

    Args:
        tablelist(list): a list of lists each list is a row on the table

    Returns:
        tablelist(list): input but with padding so all entries are the same
                         width as the widest entry
    """
    columnlengths = [0 for x in tablelist[0]]
    for row in tablelist:
        colno = 0
        for column in row:
            columnlength = len(str(column))
            if columnlength > columnlengths[colno]:
                columnlengths[colno] = columnlength
            colno += 1
    for row in tablelist:
        colno = 0
        for column in row:
            columnlength = len(str(column))
            padding = columnlengths[row.index(column)] - columnlength
            row[row.index(column)] = str(column) + ' ' * padding
    for line in tablelist:
        print('  '.join([str(x) for x in line]))
    return tablelist