def output(self, rows):
    'Output the given rows in tabular format. Each rows is a list of\n        string values. All rows are expected to have the sam elength. The first\n        row is the table header.\n\n        Parameters\n        ----------\n        rows: list(string)\n            List of rows in the table\n        '
    columns = ([0] * len(rows[0]))
    for row in rows:
        for col in range(len(columns)):
            count = len(row[col])
            if (count > columns[col]):
                columns[col] = count
    format = None
    divider = list()
    for col_len in columns:
        f = (('%-' + str(col_len)) + 's')
        if (format is None):
            format = f
        else:
            format += (' | ' + f)
        if (len(divider) in [0, (len(columns) - 1)]):
            i = 1
        else:
            i = 2
        divider.append(('-' * (col_len + i)))
    print((format % tuple(rows[0])))
    print('|'.join(divider))
    for row in rows[1:]:
        print((format % tuple(row)))
Output the given rows in tabular format. Each rows is a list of
string values. All rows are expected to have the sam elength. The first
row is the table header.

Parameters
----------
rows: list(string)
    List of rows in the table
def output(self, rows):
    'Output the given rows in tabular format. Each rows is a list of\n        string values. All rows are expected to have the sam elength. The first\n        row is the table header.\n\n        Parameters\n        ----------\n        rows: list(string)\n            List of rows in the table\n        '
    columns = ([0] * len(rows[0]))
    for row in rows:
        for col in range(len(columns)):
            count = len(row[col])
            if (count > columns[col]):
                columns[col] = count
    format = None
    divider = list()
    for col_len in columns:
        f = (('%-' + str(col_len)) + 's')
        if (format is None):
            format = f
        else:
            format += (' | ' + f)
        if (len(divider) in [0, (len(columns) - 1)]):
            i = 1
        else:
            i = 2
        divider.append(('-' * (col_len + i)))
    print((format % tuple(rows[0])))
    print('|'.join(divider))
    for row in rows[1:]:
        print((format % tuple(row)))