|
|
None | __init__ (self, *Union[Column, str] headers, Optional[TextType] title=None, Optional[TextType] caption=None, Optional[int] width=None, Optional[int] min_width=None, Optional[box.Box] box=box.HEAVY_HEAD, Optional[bool] safe_box=None, PaddingDimensions padding=(0, 1), bool collapse_padding=False, bool pad_edge=True, bool expand=False, bool show_header=True, bool show_footer=False, bool show_edge=True, bool show_lines=False, int leading=0, StyleType style="none", Optional[Iterable[StyleType]] row_styles=None, Optional[StyleType] header_style="table.header", Optional[StyleType] footer_style="table.footer", Optional[StyleType] border_style=None, Optional[StyleType] title_style=None, Optional[StyleType] caption_style=None, "JustifyMethod" title_justify="center", "JustifyMethod" caption_justify="center", bool highlight=False) |
| |
| "Table" | grid (cls, *Union[Column, str] headers, PaddingDimensions padding=0, bool collapse_padding=True, bool pad_edge=False, bool expand=False) |
| |
| bool | expand (self) |
| |
| None | expand (self, bool expand) |
| |
| int | row_count (self) |
| |
| StyleType | get_row_style (self, "Console" console, int index) |
| |
|
Measurement | __rich_measure__ (self, "Console" console, "ConsoleOptions" options) |
| |
| Tuple[int, int, int, int] | padding (self) |
| |
| "Table" | padding (self, PaddingDimensions padding) |
| |
| None | add_column (self, "RenderableType" header="", "RenderableType" footer="", *Optional[StyleType] header_style=None, Optional[StyleType] footer_style=None, Optional[StyleType] style=None, "JustifyMethod" justify="left", "VerticalAlignMethod" vertical="top", "OverflowMethod" overflow="ellipsis", Optional[int] width=None, Optional[int] min_width=None, Optional[int] max_width=None, Optional[int] ratio=None, bool no_wrap=False) |
| |
| None | add_row (self, *Optional["RenderableType"] renderables, Optional[StyleType] style=None, bool end_section=False) |
| |
| None | add_section (self) |
| |
|
"RenderResult" | __rich_console__ (self, "Console" console, "ConsoleOptions" options) |
| |
A console renderable to draw a table.
Args:
*headers (Union[Column, str]): Column headers, either as a string, or :class:`~rich.table.Column` instance.
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 characters of the table, or ``None`` to automatically fit. Defaults to None.
min_width (Optional[int], optional): The minimum width of the table, or ``None`` for no minimum. Defaults to None.
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.
safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.
padding (PaddingDimensions, optional): Padding for cells (top, right, bottom, left). Defaults to (0, 1).
collapse_padding (bool, optional): Enable collapsing of padding around cells. Defaults to False.
pad_edge (bool, optional): Enable padding of edge cells. Defaults to True.
expand (bool, optional): Expand the table to fit the available space if ``True``, otherwise the table width will be auto-calculated. Defaults to False.
show_header (bool, optional): Show a header row. Defaults to True.
show_footer (bool, optional): Show a footer row. Defaults to False.
show_edge (bool, optional): Draw a box around the outside of the table. Defaults to True.
show_lines (bool, optional): Draw lines between every row. Defaults to False.
leading (bool, optional): Number of blank lines between rows (precludes ``show_lines``). Defaults to 0.
style (Union[str, Style], optional): Default style for the table. Defaults to "none".
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.
header_style (Union[str, Style], optional): Style of the header. Defaults to "table.header".
footer_style (Union[str, Style], optional): Style of the footer. Defaults to "table.footer".
border_style (Union[str, Style], optional): Style of the border. Defaults to None.
title_style (Union[str, Style], optional): Style of the title. Defaults to None.
caption_style (Union[str, Style], optional): Style of the caption. Defaults to None.
title_justify (str, optional): Justify method for title. Defaults to "center".
caption_justify (str, optional): Justify method for caption. Defaults to "center".
highlight (bool, optional): Highlight cell contents (if str). Defaults to False.
| None pip._vendor.rich.table.Table.add_column |
( |
|
self, |
|
|
"RenderableType" |
header = "", |
|
|
"RenderableType" |
footer = "", |
|
|
*Optional[StyleType] |
header_style = None, |
|
|
Optional[StyleType] |
footer_style = None, |
|
|
Optional[StyleType] |
style = None, |
|
|
"JustifyMethod" |
justify = "left", |
|
|
"VerticalAlignMethod" |
vertical = "top", |
|
|
"OverflowMethod" |
overflow = "ellipsis", |
|
|
Optional[int] |
width = None, |
|
|
Optional[int] |
min_width = None, |
|
|
Optional[int] |
max_width = None, |
|
|
Optional[int] |
ratio = None, |
|
|
bool |
no_wrap = False |
|
) |
| |
Add a column to the table.
Args:
header (RenderableType, optional): Text or renderable for the header.
Defaults to "".
footer (RenderableType, optional): Text or renderable for the footer.
Defaults to "".
header_style (Union[str, Style], optional): Style for the header, or None for default. Defaults to None.
footer_style (Union[str, Style], optional): Style for the footer, or None for default. Defaults to None.
style (Union[str, Style], optional): Style for the column cells, or None for default. Defaults to None.
justify (JustifyMethod, optional): Alignment for cells. Defaults to "left".
vertical (VerticalAlignMethod, optional): Vertical alignment, one of "top", "middle", or "bottom". Defaults to "top".
overflow (OverflowMethod): Overflow method: "crop", "fold", "ellipsis". Defaults to "ellipsis".
width (int, optional): Desired width of column in characters, or None to fit to contents. Defaults to None.
min_width (Optional[int], optional): Minimum width of column, or ``None`` for no minimum. Defaults to None.
max_width (Optional[int], optional): Maximum width of column, or ``None`` for no maximum. Defaults to None.
ratio (int, optional): Flexible ratio for the column (requires ``Table.expand`` or ``Table.width``). Defaults to None.
no_wrap (bool, optional): Set to ``True`` to disable wrapping of this column.