MCPcopy
hub / github.com/Textualize/rich / Column

Class Column

rich/table.py:39–128  ·  view source on GitHub ↗

Defines a column within a ~Table. Args: title (Union[str, Text], optional): The title of the table rendered at the top. Defaults to None. caption (Union[str, Text], optional): The table caption rendered below. Defaults to None. width (int, optional): The width in charact

Source from the content-addressed store, hash-verified

37
38@dataclass
39class Column:
40 """Defines a column within a ~Table.
41
42 Args:
43 title (Union[str, Text], optional): The title of the table rendered at the top. Defaults to None.
44 caption (Union[str, Text], optional): The table caption rendered below. Defaults to None.
45 width (int, optional): The width in characters of the table, or ``None`` to automatically fit. Defaults to None.
46 min_width (Optional[int], optional): The minimum width of the table, or ``None`` for no minimum. Defaults to None.
47 box (box.Box, optional): One of the constants in box.py used to draw the edges (see :ref:`appendix_box`), or ``None`` for no box lines. Defaults to box.HEAVY_HEAD.
48 safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.
49 padding (PaddingDimensions, optional): Padding for cells (top, right, bottom, left). Defaults to (0, 1).
50 collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to False.
51 pad_edge (bool, optional): Enable padding of edge cells. Defaults to True.
52 show_header (bool, optional): Show a header row. Defaults to True.
53 show_footer (bool, optional): Show a footer row. Defaults to False.
54 show_edge (bool, optional): Draw a box around the outside of the table. Defaults to True.
55 show_lines (bool, optional): Draw lines between every row. Defaults to False.
56 leading (int, optional): Number of blank lines between rows (precludes ``show_lines``). Defaults to 0.
57 style (Union[str, Style], optional): Default style for the table. Defaults to "none".
58 row_styles (List[Union, str], optional): Optional list of row styles, if more than one style is given then the styles will alternate. Defaults to None.
59 header_style (Union[str, Style], optional): Style of the header. Defaults to "table.header".
60 footer_style (Union[str, Style], optional): Style of the footer. Defaults to "table.footer".
61 border_style (Union[str, Style], optional): Style of the border. Defaults to None.
62 title_style (Union[str, Style], optional): Style of the title. Defaults to None.
63 caption_style (Union[str, Style], optional): Style of the caption. Defaults to None.
64 title_justify (str, optional): Justify method for title. Defaults to "center".
65 caption_justify (str, optional): Justify method for caption. Defaults to "center".
66 highlight (bool, optional): Highlight cell contents (if str). Defaults to False.
67 """
68
69 header: "RenderableType" = ""
70 """RenderableType: Renderable for the header (typically a string)"""
71
72 footer: "RenderableType" = ""
73 """RenderableType: Renderable for the footer (typically a string)"""
74
75 header_style: StyleType = ""
76 """StyleType: The style of the header."""
77
78 footer_style: StyleType = ""
79 """StyleType: The style of the footer."""
80
81 style: StyleType = ""
82 """StyleType: The style of the column."""
83
84 justify: "JustifyMethod" = "left"
85 """str: How to justify text within the column ("left", "center", "right", or "full")"""
86
87 vertical: "VerticalAlignMethod" = "top"
88 """str: How to vertically align content ("top", "middle", or "bottom")"""
89
90 overflow: "OverflowMethod" = "ellipsis"
91 """str: Overflow method."""
92
93 width: Optional[int] = None
94 """Optional[int]: Width of the column, or ``None`` (default) to auto calculate width."""
95
96 min_width: Optional[int] = None

Callers 7

test_init_append_columnFunction · 0.90
attrs.pyFile · 0.90
get_table_columnMethod · 0.85
__init__Method · 0.85
make_tasks_tableMethod · 0.85
add_columnMethod · 0.85
add_rowMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_init_append_columnFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…