Table

import { Table } from "jsr:@ende/markdown";

interface

interface Table

A table. Only parsed with the gfm option. The first row is the header row, and every row has one cell per column.

Example: Usage

import type { Table } from "@ende/markdown/types";
import { assertEquals } from "@ende/assert";

// | a |
// | -: |
const node: Table = {
  type: "table",
  align: ["right"],
  children: [{ type: "tableRow", children: [{ type: "tableCell", children: [{ type: "text", value: "a" }] }] }]
};
assertEquals(node.align, ["right"]);

Properties

type

type: "table"

Node type.

align

align: AlignType[]

The alignment of each column, from the delimiter row.

children

children: TableRow[]

The rows, starting with the header row.

Source