Podium.Table (Podium v0.3.0)

Copy Markdown View Source

Table struct and XML generation for slide tables.

Tables are represented as a grid of rows and cells with optional column/row spans, per-cell formatting, and table style booleans.

Summary

Functions

Creates a new table from a list of rows (each row is a list of cell values).

Generates the <p:graphicFrame> XML for a table.

Types

t()

@type t() :: %Podium.Table{
  col_widths: [non_neg_integer()] | nil,
  height: non_neg_integer() | nil,
  id: pos_integer() | nil,
  row_heights: [non_neg_integer()] | nil,
  rows: [[term()]],
  table_style: keyword(),
  width: non_neg_integer() | nil,
  x: non_neg_integer() | nil,
  y: non_neg_integer() | nil
}

Functions

new(id, rows, opts)

@spec new(pos_integer(), [[term()]], keyword()) :: t()

Creates a new table from a list of rows (each row is a list of cell values).

Cell values can be:

  • Plain string: "text"
  • Rich text list: [[{"bold", bold: true}]]
  • Cell tuple with options: {"text", col_span: 2, row_span: 2, fill: "FF0000", ...}
  • :merge placeholder for cells covered by a merge span

to_xml(table)

@spec to_xml(t()) :: String.t()

Generates the <p:graphicFrame> XML for a table.