rich.columns

class rich.columns.Columns(renderables: Iterable[Union[rich.console.ConsoleRenderable, rich.console.RichCast, str]] = None, padding: Union[int, Tuple[int], Tuple[int, int], Tuple[int, int, int, int]] = 0, 1, *, width: int = None, expand: bool = False, equal: bool = False, column_first: bool = False, right_to_left: bool = False, align: typing_extensions.Literal[left, center, right] = None, title: Union[str, Text] = None)[source]

Display renderables in neat columns.

Parameters
  • renderables (Iterable[RenderableType]) – Any number of Rich renderables (including str).

  • width (int, optional) – The desired width of the columns, or None to auto detect. Defaults to None.

  • padding (PaddingDimensions, optional) – Optional padding around cells. Defaults to (0, 1).

  • expand (bool, optional) – Expand columns to full width. Defaults to False.

  • equal (bool, optional) – Arrange in to equal sized columns. Defaults to False.

  • column_first (bool, optional) – Align items from top to bottom (rather than left to right). Defaults to False.

  • right_to_left (bool, optional) – Start column from right hand side. Defaults to False.

  • align (str, optional) – Align value (“left”, “right”, or “center”) or None for default. Defaults to None.

  • title (TextType, optional) – Optional title for Columns.

add_renderable(renderable: Union[rich.console.ConsoleRenderable, rich.console.RichCast, str]) → None[source]

Add a renderable to the columns.

Parameters

renderable (RenderableType) – Any renderable object.