Closed vincentarelbundock closed 6 months ago
From what I've seen, there is no straightforward way to do this. One possible way would be to add a row at the bottom, merge its cells, and suppress its borders. This package: https://github.com/PgBiel/typst-tablex makes it possible.
#import "@preview/tablex:0.0.8": tablex, colspanx, hlinex, vlinex
#figure(
tablex(
vlinex(end : 2),
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
colspanx(4)[These are notes.],
hlinex(end: 0),
vlinex(end : 2),
),
caption: [This is a caption. ],
)
The row at the bottom seems like a good solution. Is text wrapped automatically to table width or does the table stretch forever?
To wrap text automatically you can use fit-spans: (x: true)
. In my example:
#import "@preview/tablex:0.0.8": tablex, colspanx, hlinex, vlinex
#figure(
tablex(
fit-spans: (x: true),
vlinex(end : 2),
columns: 4,
[t], [1], [2], [3],
[y], [0.3s], [0.4s], [0.8s],
colspanx(4)[These are very long notes.],
hlinex(end: 0),
vlinex(end : 2),
),
caption: [This is a caption. ],
)
@florence-laflamme how do we add notes at the bottom of a table in Typst?