Method: rich.table.Table.add_column
Calls: 142, Exceptions: 0, Paths: 1Back
Path 1: 142 calls (1.0)
'' (119) 'foo' (3) '1' (2) '2' (2) 'test_header' (2) 'Feature' (1) 'Demonstration' (1) '[green]Date' (1) '[blue]Title' (1) '[cyan]Production Budget' (...
'' (141) Text (1)
None (142)
None (142)
None (59) 'log.message' (22) 'log.time' (21) 'log.path' (19) 'log.level' (16) 'bold red' (1) 'green' (1) 'blue' (1) 'cyan' (1) 'magenta' (1)
'left' (119) 'right' (21) 'center' (2)
'top' (140) 'middle' (1) 'bottom' (1)
'ellipsis' (120) 'fold' (22)
None (142)
None (142)
None (142)
None (115) 1 (27)
False (137) True (5)
1def add_column(
2 self,
3 header: "RenderableType" = "",
4 footer: "RenderableType" = "",
5 *,
6 header_style: Optional[StyleType] = None,
7 footer_style: Optional[StyleType] = None,
8 style: Optional[StyleType] = None,
9 justify: "JustifyMethod" = "left",
10 vertical: "VerticalAlignMethod" = "top",
11 overflow: "OverflowMethod" = "ellipsis",
12 width: Optional[int] = None,
13 min_width: Optional[int] = None,
14 max_width: Optional[int] = None,
15 ratio: Optional[int] = None,
16 no_wrap: bool = False,
17 ) -> None:
18 """Add a column to the table.
19
20 Args:
21 header (RenderableType, optional): Text or renderable for the header.
22 Defaults to "".
23 footer (RenderableType, optional): Text or renderable for the footer.
24 Defaults to "".
25 header_style (Union[str, Style], optional): Style for the header, or None for default. Defaults to None.
26 footer_style (Union[str, Style], optional): Style for the footer, or None for default. Defaults to None.
27 style (Union[str, Style], optional): Style for the column cells, or None for default. Defaults to None.
28 justify (JustifyMethod, optional): Alignment for cells. Defaults to "left".
29 vertical (VerticalAlignMethod, optional): Vertical alignment, one of "top", "middle", or "bottom". Defaults to "top".
30 overflow (OverflowMethod): Overflow method: "crop", "fold", "ellipsis". Defaults to "ellipsis".
31 width (int, optional): Desired width of column in characters, or None to fit to contents. Defaults to None.
32 min_width (Optional[int], optional): Minimum width of column, or ``None`` for no minimum. Defaults to None.
33 max_width (Optional[int], optional): Maximum width of column, or ``None`` for no maximum. Defaults to None.
34 ratio (int, optional): Flexible ratio for the column (requires ``Table.expand`` or ``Table.width``). Defaults to None.
35 no_wrap (bool, optional): Set to ``True`` to disable wrapping of this column.
36 """
37
38 column = Column(
39 _index=len(self.columns),
40 header=header,
41 footer=footer,
42 header_style=header_style or "",
43 footer_style=footer_style or "",
44 style=style or "",
45 justify=justify,
46 vertical=vertical,
47 overflow=overflow,
48 width=width,
49 min_width=min_width,
50 max_width=max_width,
51 ratio=ratio,
52 no_wrap=no_wrap,
53 )
54 self.columns.append(column)