Typst-Snippets/table.typ
2024-01-05 00:55:01 +08:00

19 lines
509 B
Plaintext

#import "@preview/tablex:0.0.6": tablex, rowspanx, colspanx, hlinex, vlinex
#let three-line-table(columns, headers, contents, caption, lang: "en",rows: auto) = {figure(
tablex(
columns: columns,
rows: rows,
align: center + horizon,
auto-lines: false,
repeat-header: true,
hlinex(stroke: 1.5pt),
..headers,
hlinex(stroke: 0.75pt),
..contents,
hlinex(stroke: 1.5pt),
),
kind: table,
supplement: [#if (lang == "en") {"Table"} else {"表"}],
caption: caption,
)}