Skip to content

Commit

Permalink
Enable per-column enabling or disabling of highlighting
Browse files Browse the repository at this point in the history
Defaults to the value of the self.table when the default value of None is unchanged.

It seems like the Column constructor didn't receive a `highlight` value, so I guess that it used to receive a highlight value at a later point. Someone who knows the project better could comment on that.
  • Loading branch information
JulesGM authored Oct 24, 2023
1 parent e9f75c9 commit a9669b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rich/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def add_column(
footer: "RenderableType" = "",
*,
header_style: Optional[StyleType] = None,
highlight: Optional[bool] = None,
footer_style: Optional[StyleType] = None,
style: Optional[StyleType] = None,
justify: "JustifyMethod" = "left",
Expand All @@ -385,6 +386,7 @@ def add_column(
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.
highlight (bool, optional): Whether to highlight the text. The default of None uses the value of the table (self) object.
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".
Expand All @@ -402,6 +404,7 @@ def add_column(
header=header,
footer=footer,
header_style=header_style or "",
highlight=highlight if highlight is not None else self.highlight,
footer_style=footer_style or "",
style=style or "",
justify=justify,
Expand Down

0 comments on commit a9669b8

Please sign in to comment.