def METHOD_NAME(header: [str], rows: [[str]], colw: [int]) -> str:
  ncols = len(header)
  out = []
  # print header labels
  out.append('|')
  for i in range(ncols):
    out.append(' %-*s |' % (colw[i], header[i]))
  out.append('\n')
  # print header divider
  out.append('|')
  for i in range(ncols):
    out.append(' :' + ('-' * max(0, colw[i] - 1)) + ' |')
  out.append('\n')
  # print data rows
  for row in rows:
    out.append('|')
    for i in range(ncols):
      out.append(' %-*s |' % (colw[i], row[i]))
    out.append('\n')
  out.pop()
  return ''.join(out)