package mosaic

  1. Overview
  2. Docs

Module Mosaic_mlx.TableSource

Companion types for the table widget.

type alignment = Mosaic_ui.Table.alignment

Horizontal text alignment: `Left, `Right, or `Center. Defaults to `Left.

Column width strategy: `Auto, `Fixed of int, or `Fraction of float. Defaults to `Auto.

type overflow = Mosaic_ui.Table.overflow

Cell content overflow: `Ellipsis or `Wrap. Defaults to `Ellipsis.

type column = Mosaic_ui.Table.column = {
  1. header : string;
    (*

    Column header text.

    *)
  2. width : width;
    (*

    Sizing strategy.

    *)
  3. alignment : alignment;
    (*

    Text alignment.

    *)
  4. overflow : overflow;
    (*

    Content overflow strategy.

    *)
  5. min_width : int option;
    (*

    Minimum column width in cells.

    *)
  6. max_width : int option;
    (*

    Maximum column width in cells.

    *)
}

The type for column definitions. Use column to create values with sensible defaults.

val column : ?width:width -> ?alignment:alignment -> ?overflow:overflow -> ?min_width:int -> ?max_width:int -> string -> column

column header is a column definition with the given header.

width defaults to `Auto. alignment defaults to `Left. overflow defaults to `Ellipsis.

The type for table cell content.

val cell : ?style:Ansi.Style.t -> string -> cell

cell s is a plain-text cell containing s.

style defaults to Ansi.Style.default.

val rich : Mosaic_ui.Text.fragment list -> cell

rich fragments is a styled cell built from a list of styled text fragments.