How can i make a table cell pass each other?

At first this seems puzzling, but then it’s clear that typst’s result with two columns is logical: the height of the second row is a free variable that can be set to zero because there is nothing that forces that row to be any higher than that.

An alternate solution is to use defined row heights, so we give the otherwise vanishing second row a real height:

#table(
  columns: 2,
  rows: (auto, 2em, auto),
  fill: (x, y) => blue.lighten(30% * y),
  table.cell(rowspan: 2, "a"),
  "b",
  table.cell(rowspan: 2, "c"),
  "d",
)

bild

And just out of interest I colored the cells in blue shades by their row index y to see what it would say… below it shows that we have rows 0, 1, 2 also when collapsed:

bild

6 Likes