Skip to content

table()

ts
function table(...rows): Node;

Defined in: table.ts:255

Builder-element for a table

Parameters

ParameterTypeDescription
...rows(TableRowNode | null | undefined)[]Rows of this table

Returns

Node

A markdown node

Example

ts
import { define, table, tableRow, tableCell } from "@ogs-gmbh/markdown";

const markdown = define(
  table(
    tableRow(
      tableCell("Name", "left"),
      tableCell("Price", "left"),
    ),
    tableRow(
      tableCell("Smartphone", "left"),
      tableCell("1.300,00 €", "left"),
    )
  )
);

console.assert(
  markdown.toString()
);

See

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables

Since

1.0.0

Author

Simon Kovtyk