towhee.functional.mixins.display.to_printable_table

towhee.functional.mixins.display.to_printable_table(data, header=None, tablefmt='html', formatter={})[source]

Convert two dimensional data structure into printable table

Parameters:
  • data (List[List], or List[Dict]) – The data filled into table. If a list of dict is given, keys are used as column names.

  • header (Iterable[str]), optional) – The names of columns defined by user. Defaults to None.

  • tablefmt (str, optional) – The format of the output, supports html, plain, grid.. Defaults to ‘html’.

Raises:

ValueError – Unsupported table format

Returns:

The table.

Return type:

str