PgBiel/typst-tablex

Superfluous row when using cells with arbitrary `y`

PgBiel opened this issue · 2 comments

PgBiel commented

The usage of tablex shown below has the following (unexpected) output, with one more row than necessary:

#tablex(
  columns: 3,
  [a],
  cellx(y: 2)[a]
)

image

PgBiel commented

These lines seem to be cause.

typst-tablex/tablex.typ

Lines 231 to 235 in b3b441f

let is_at_first_column(grid_len) = calc-mod(grid_len, col_len) == 0
while not is_at_first_column(get-expected-grid-len(items + new_items, col_len: col_len)) { // fix incomplete rows
new_items.push(cellx[])
}

I might just remove them, as trying to predict the grid length is just an heuristic after all, and having an "incomplete row" is fixed by the last few lines of the grid generator function (which goes over any none items in the grid and replaces them with empty cells).

PgBiel commented

Fixed in 7780d91.