code: def table_measure(self, columns, content):
          
          dimensions = {}
          for row in content:
              i = 0
              for cell in row:
                  # Calculate maximum from:
                  dimensions[i] = max(
                          dimensions.get(i, 0),              # current column max width
                          len(cell),                         # current cell value width
                          len(columns[i].get('label', '')),  # column label width
                          columns[i].get('width_min', 0),    # configured column minimal width
                      )
                  i += 1
          return dimensions
docs: Measure the width of each table column.