# `Typst.Format.Table`
[🔗](https://github.com/Hermanverschooten/typst/blob/main/lib/format/table.ex#L1)

Creates a typst [`#table()`](https://typst.app/docs/reference/model/table) and implements the `String.Chars` protocol for easy EEx interpolation.
To build more complex tables you can use the structs under this module like `Typst.Format.Table.Hline`

## Examples

    iex> alias Typst.Format.Table
    ...> %Table{columns: 2, content: [["hello", "world"], ["foo", "bar"]]} |> to_string()
    "#table(columns: 2, [hello], [world], [foo], [bar])"

    iex> alias Typst.Format.Table
    ...> alias Typst.Format.Table.Hline
    ...> import Typst.Format
    ...> %Table{columns: array(["1fr", "1fr"]), content: [["hello", "world"], %Hline{start: 1}, ["foo", "bar"]]} |> to_string()
    "#table(columns: (1fr, 1fr), [hello], [world], table.hline(start: 1), [foo], [bar])"

# `t`

```elixir
@type t() :: %Typst.Format.Table{
  align: String.t(),
  column_gutter: non_neg_integer() | String.t(),
  columns: non_neg_integer() | String.t(),
  content: String.Chars.t() | [String.Chars.t()],
  fill: String.t(),
  gutter: non_neg_integer() | String.t(),
  inset: String.t(),
  row_gutter: non_neg_integer() | String.t(),
  rows: non_neg_integer() | String.t(),
  stroke: String.t()
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
