class RatatuiRuby::Widgets::Cell

A styled table cell combining content with optional styling.

By default, Table cells are plain strings. For more control over cell styling, wrap the content in a Cell object to apply cell-level background style.

The content can be a String, Text::Span, or Text::Line. The style applies to the entire cell area (background).

Examples

# Cell with yellow background
Widgets::Cell.new(content: "Warning", style: Style::Style.new(bg: :yellow))

# Cell with rich text content
Widgets::Cell.new(
  content: Text::Line.new(spans: [
    Text::Span.new(content: "Error: ", style: Style::Style.new(fg: :red)),
    Text::Span.new(content: "Details here")
  ]),
  style: Style::Style.new(bg: :dark_gray)
)