Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-3542: Update Colum Class Args Doc #3573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The following people have contributed to the development of Rich:
- [Aaron Stephens](https://github.com/aaronst)
- [Karolina Surma](https://github.com/befeleme)
- [Gabriele N. Tornetta](https://github.com/p403n1x87)
- [Stan Ulbrych](https://github.com/stanfromireland)
- [Nils Vu](https://github.com/nilsvu)
- [Arian Mollik Wasi](https://github.com/wasi-master)
- [Jan van Wijk](https://github.com/jdvanwijk)
Expand Down
39 changes: 14 additions & 25 deletions rich/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,20 @@ class Column:
"""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 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 (int, 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.
header (RenderableType): Renderable for the header (typically a string).
footer (RenderableType, optional): Renderable for the footer (typically a string). Defaults to an empty string.
header_style (StyleType, optional): The style of the header. Defaults to an empty string.
footer_style (StyleType, optional): The style of the footer. Defaults to an empty string.
style (StyleType, optional): The style of the column. Defaults to an empty string.
justify (str, optional): How to justify text within the column ("left", "center", "right", or "full"). Defaults to "left".
vertical (str, optional): How to vertically align content ("top", "middle", or "bottom"). Defaults to "top".
overflow (str, optional): Overflow method (e.g., "ellipsis"). Defaults to "ellipsis".
width (Optional[int], optional): Width of the column, or ``None`` (default) to auto-calculate width.
min_width (Optional[int], optional): Minimum width of the column, or ``None`` for no minimum. Defaults to None.
max_width (Optional[int], optional): Maximum width of the column, or ``None`` for no maximum. Defaults to None.
ratio (Optional[int], optional): Ratio to use when calculating column width, or ``None`` to adapt to column contents. Defaults to None.
no_wrap (bool, optional): Prevent wrapping of text within the column. Defaults to ``False``.
highlight (bool, optional): Apply highlighter to column contents. Defaults to ``False``.
"""

header: "RenderableType" = ""
Expand Down