How to make a table formatting condition for just one table?

I think for now you only have 1 option: use an additional scope:

#{
  show table.cell.where(y: 0): strong
  table(table.header[header], [cell], [cell])
}
#table(table.header[header], [cell], [cell])

image

The second option isn’t implemented yet: Resetting `show` and `set` to its default / Revoke rules · Issue #420 · typst/typst · GitHub.

There is another workaround (that has its advantages) that uses a user-defined function as a wrapper for the table.header:

#let table-header(..headers) = {
  table.header(..headers.pos().map(strong))
}

Related issue: Show-set rules don't seem to work for `table.cell` · Issue #4159 · typst/typst · GitHub .

Related issue: Unable to style `table.header` and `table.footer` · Issue #3640 · typst/typst · GitHub.

1 Like