PgBiel/typst-tablex

Cell fill from a lower row overlapping onto top hline

PgBiel opened this issue · 4 comments

PgBiel commented

Generating smaller hlines than normal (missing the bottom half of the stroke).

image

PgBiel commented

This might require #2 for a proper solution.

This really needs to get fixed. Without fill is not useable.

I found a workaround. Having a 0cm row that spans all columns and a 0cm column that spans all rows fixes the issue.

This looks correct:

#tablex(
    fill: luma(240),
    columns: (0cm, 1fr, 1fr),
    rowspanx(3)[], [?], [?],
    (), [?], [?], 
    (), [?], [?], 
)

but this does not:

#tablex(
    fill: luma(240),
    columns: (0cm, 1fr, 1fr),
    (), [?], [?],
    (), [?], [?], 
    (), [?], [?], 
)

Yep, that will work (as will setting header-rows to a really high value) because it will force tablex to draw all of your cells at the same time (instead of drawing per row / rowspan), drawing cells first and then lines, which circumvents this problem. However, that will make it impossible to split your table across pages.

I plan on tackling this on 0.1.0 by providing a new renderer which will draw per page instead of per row, which is how native tables do it, but I haven't gotten to it yet (I also haven't yet experimented with the idea to know how much of it is possible).