code: def table(data, headers=None, format_spec=FMT, width=WIDTH, align=ALIGN, style=STYLE, out=sys.stdout):
      
      # Number of columns in the table.
      ncols = len(data[0]) if headers is None else len(headers)
      tablestyle = STYLES[style]
      widths = parse_width(width, ncols)
  
      # Initialize with a hr or the header
      tablestr = [hrule(ncols, widths, tablestyle.top)] \
          if headers is None else [header(headers, width=widths, align=align, style=style)]
  
      # parse each row
      tablestr += [row(d, widths, format_spec, align, style) for d in data]
  
      # only add the final border if there was data in the table
      if len(data) > 0:
          tablestr += [hrule(ncols, widths, tablestyle.bottom)]
  
      # print the table
      out.write('\n'.join(tablestr) + '\n')
      out.flush()
docs: Print a table with the given data
  
      Parameters
      ----------
      data : array_like
          An (m x n) array containing the data to print (m rows of n columns)
  
      headers : list, optional
          A list of n strings consisting of the header of each of the n columns (Default: None)
  
      format_spec : string, optional
          Format specification for formatting numbers (Default: '5g')
  
      width : int or array_like, optional
          The width of each column in the table (Default: 11)
  
      align : string
          The alignment to use ('left', 'center', or 'right'). (Default: 'right')
  
      style : string or tuple, optional
          A formatting style. (Default: 'fancy_grid')
  
      out : writer, optional
          A file handle or object that has write() and flush() methods (Default: sys.stdout)