PgBiel / typst-tablex

More powerful and customizable tables in Typst
MIT License
370 stars 12 forks source link

Dynamic cells with map-cells option #121

Closed KaliszS closed 6 months ago

KaliszS commented 6 months ago

Hello, is that possible to make cells template dynamic if I use map-cells option? I've got code like that:

tablex(
    columns: cols_number,
    column-gutter: 10pt,
    auto-vlines: false,
    auto-hlines: false,
    align: center + horizon,
    map-cells: cell => {
      lang(
        langs.at(
          cell.x + cell.y * cols_number
        ),
        level
      )
    },

    [], [], [], [], [], [], [], [], [], []
  )

But since it's part of the function called multiple times for different number of cells, I would like to cut the last line: [], [], [], [], [], [], [], [], [], []. Thanks in advance for your help :)

I'm using tablex v 0.0.8 btw.