Skip to content

TableModule

TableModule

PARAMETER DESCRIPTION
columns

A list of columns to show. Default shows all columns.

TYPE: list[str] DEFAULT: None

show_header

Set true to show table header.

TYPE: bool DEFAULT: False

sizes

Width (in characters) of each column, 0 fits content. If list is shorted than number of columns, missing column widths will default to 0.

TYPE: list[int] DEFAULT: None

sort

See Sorting

TYPE: str | tuple[str, bool] | list[str | tuple[str, bool]] DEFAULT: None

**kwargs

TYPE: Any DEFAULT: {}

Sorting

Rows can be sorted by a single column name, or by a list of column names, in each case you can choose whether to reverse the sorting order.

  • Single column
    sort: column name
    
  • Single column, reverse
    sort: [column name, True]
    
  • Multiple columns
    sort:
        - column 1
        - column 2
        - column 3
        #...
    
  • Multiple columns, reverse
    sort:
        - [column 1, false]
        - [column 2, true]
        - [column 3, true]
        - column 4         # equals to [column 4, false]
        #...