Files
pandoc/test/tables.typst
T
John MacFarlane 604f541b0f Typst writer: support Typst 0.11 table features. (#9593)
* Typst writer: support Typst 0.11 table features.

- colspans
- rowspans
- cell alignment overrides
- relative column widths
- header and footer
- multiple table bodies with intermediate headers

Row heads are not yet supported.

The default typst template has been modified so that tables
don't have lines by default. As is standard with pandoc, we only
add a line under a header or over a footer. However, a different
default stroke pattern can easily be added in a template.

Closes #9588.
2024-03-20 14:25:08 -07:00

106 lines
2.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Simple table with caption:
#figure(
align(center)[#table(
columns: 4,
align: (right,left,center,auto,),
table.header([Right], [Left], [Center], [Default],),
table.hline(),
[12], [12], [12], [12],
[123], [123], [123], [123],
[1], [1], [1], [1],
)]
, caption: [Demonstration of simple table syntax.]
, kind: table
)
Simple table without caption:
#figure(
align(center)[#table(
columns: 4,
align: (right,left,center,auto,),
table.header([Right], [Left], [Center], [Default],),
table.hline(),
[12], [12], [12], [12],
[123], [123], [123], [123],
[1], [1], [1], [1],
)]
, kind: table
)
Simple table indented two spaces:
#figure(
align(center)[#table(
columns: 4,
align: (right,left,center,auto,),
table.header([Right], [Left], [Center], [Default],),
table.hline(),
[12], [12], [12], [12],
[123], [123], [123], [123],
[1], [1], [1], [1],
)]
, caption: [Demonstration of simple table syntax.]
, kind: table
)
Multiline table with caption:
#figure(
align(center)[#table(
columns: (15%, 13.75%, 16.25%, 35%),
align: (center,left,right,left,),
table.header([Centered Header], [Left Aligned], [Right Aligned], [Default
aligned],),
table.hline(),
[First], [row], [12.0], [Example of a row that spans multiple lines.],
[Second], [row], [5.0], [Heres another one. Note the blank line between
rows.],
)]
, caption: [Heres the caption. It may span multiple lines.]
, kind: table
)
Multiline table without caption:
#figure(
align(center)[#table(
columns: (15%, 13.75%, 16.25%, 35%),
align: (center,left,right,left,),
table.header([Centered Header], [Left Aligned], [Right Aligned], [Default
aligned],),
table.hline(),
[First], [row], [12.0], [Example of a row that spans multiple lines.],
[Second], [row], [5.0], [Heres another one. Note the blank line between
rows.],
)]
, kind: table
)
Table without column headers:
#figure(
align(center)[#table(
columns: 4,
align: (right,left,center,right,),
[12], [12], [12], [12],
[123], [123], [123], [123],
[1], [1], [1], [1],
)]
, kind: table
)
Multiline table without column headers:
#figure(
align(center)[#table(
columns: (15%, 13.75%, 16.25%, 35%),
align: (center,left,right,auto,),
[First], [row], [12.0], [Example of a row that spans multiple lines.],
[Second], [row], [5.0], [Heres another one. Note the blank line between
rows.],
)]
, kind: table
)