rich.columns

class rich.columns.Columns(renderables=None, padding=(0, 1), *, width=None, expand=False, equal=False, column_first=False, right_to_left=False, align=None, title=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)[source]

Add a renderable to the columns.

Parameters

renderable (RenderableType) – Any renderable object.

Return type

None