def format_table(table, extra_space=1):
 if (not table):
  return [[]]
 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

def format_table ( table , extra_space = 1 ) : if ( not table ) : return [ [ ] ] 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
note: evennia .