Home

Awesome

Tablem

Write markdown-like tables easily.

Example

Have a look at the source here.

Example

Usage

You can simply copy the markdown table and paste it in tablem function.

#import "@preview/tablem:0.1.0": tablem

#tablem[
  | *Name* | *Location* | *Height* | *Score* |
  | ------ | ---------- | -------- | ------- |
  | John   | Second St. | 180 cm   |  5      |
  | Wally  | Third Av.  | 160 cm   |  10     |
]

And you can use custom render function.

#import "@preview/tablem:0.1.0": tablem

#let three-line-table = tablem.with(
  render: (columns: auto, ..args) => {
    table(
      columns: columns,
      stroke: none,
      align: center + horizon,
      table.hline(y: 0),
      table.hline(y: 1, stroke: .5pt),
      ..args,
      table.hline(),
    )
  }
)

#three-line-table[
  | *Name* | *Location* | *Height* | *Score* |
  | ------ | ---------- | -------- | ------- |
  | John   | Second St. | 180 cm   |  5      |
  | Wally  | Third Av.  | 160 cm   |  10     |
]

Example

tablem function

#let tablem(
  render: table,
  ignore-second-row: true,
  ..args,
  body
) = { .. }

Arguments:

Limitations

Cell merging has not yet been implemented.

License

This project is licensed under the MIT License.