def get_col_widths(table, tab_width=2, tab_level=0, col_padding=0):
  """Recursively get the list of max number of characters of each column in table.

  Parameters:
    table (dict): The table to check (has "fields" and "records" properties) 
    tab_width (int): The amount of space to leave for tabs. By default, 2.
    tab_level (int): The number of tables this table is nested within. By default, 0.
    col_padding (int): How much space to pad columns with. By default, 0.
  
  Returns:
    list: List of ints corresponding to the maximum number of characters per table column.
  """
  col_widths = []
  for cell in table["fields"]:
      col_widths.append(len(cell["text"])+col_padding)
  col_widths[0] += tab_width * tab_level
  
  # take max of this col_widths or col_widths returned by recursing on children
  for row in table["records"]:
      child_widths = get_col_widths(row, tab_width, tab_level + 1, col_padding)
      for i in range(0,len(col_widths)):
          col_widths[i] = max(col_widths[i],child_widths[i])
  
  return col_widths