'Helper method to format the ansi/xterm256 tables.
Takes a table of columns [[val,val,...],[val,val,...],...]'

def table_format(self, table):

    if (not table):
        return [[]]
    extra_space = 1
    max_widths = [max([len(str(val)) for val in col]) for col in table]
    ftable = []
    for irow in range(len(table[0])):
        ftable.append([(str(col[irow]).ljust(max_widths[icol]) + ('    ' * extra_space)) for (icol, col) in enumerate(table)])
    return ftable
