#Text overflows into next cell

8 messages · Page 1 of 1 (latest)

terse egret
#

Hi,
I'm trying to create a table, sometimes text in cell overflows to the next even with row set to auto
How can I fix this issue?

grid(
      columns: (1fr),
      rows:(auto),
      align: left,
      pad(y: 2pt, text(txn.date))
    ),
    grid(
      columns: (1fr),
      rows:(auto),
      align: left,
      pad(y: 2pt, text((txn.narration)))
    )
civic totem
#

you can either increase the page width, or add some breakpoints , typst doesnt know how to break that into multiple lines

#

usually thats done via spaces, but you can also add sym.zws between each character if you dont want to add spaces

#

also btw text(...) does nothing and is redundant

civic totem
#

?r t=l

#let transactions = (
  (date: [1 Jan' 30], desc: "SOMETHING_SOMETHING", ref: [1234567891234]),
  (date: [1 Jan' 30], desc: "SOM/abcdefabcdefabcdefabcdefabcdefabcdefabcdef", ref: [1234567891234]),
)
#table(
  columns: (1fr, 1fr, 1fr),
  stroke: none,
  table.cell(colspan: 3, stroke: (bottom: 1.5pt + gray))[*Statement*],
  [*Date*], [*Description*], [*Ref. No.*],
  ..transactions.map(txn => {
    let (date, desc, ref) = txn
    desc = desc.codepoints().map(x => x + sym.zws).join()

    (date, desc, ref)
  }).flatten()
)
civic totem
#

there we go