code: def generate_table(data, headers=None):
      content = ""
      # calculate max_widths
      num_columns = len(data[0])
      max_widths = [0] * len(data[0])
      for item in data:
          for i in range(num_columns):
              max_widths[i] = max(max_widths[i], len(str(item[i])))
      # generate table headers
      if headers:
          for i, item in enumerate(headers):
              max_widths[i] = max(max_widths[i], len(str(item)))
          header_str = ""
          for i, item in enumerate(headers):
              header_str += "| {item:{width}} ".format(
                  item=item, width=max_widths[i]
              )
          header_str += "|\n"
          for i, item in enumerate(headers):
              border_str = "|" if i == 0 else "+"
              header_str += border_str + "-" * (max_widths[i] + 2)
          header_str += "|\n"
      content += header_str
      # generate table body
      for row in data:
          data_str = ""
          for i, item in enumerate(row):
              data_str += "| {item:{width}} ".format(
                  item=str(item), width=max_widths[i]
              )
          data_str += "|\n"
          content += data_str
      return content
  
label_desc: Use image node_id 1 for calling a global function with example usage: generate_table(data, headers) and returns: content