Hey @nemolivier, welcome to the forum! I’ve updated your post title to better suit our question post guidelines: How to post in the Questions category
Make sure your post title is a question you’d ask to a friend about Typst.
Here’s an example based on something I’ve made before. Note that we use 0pt columns for the interval limits. Feel free to customize and use it as much as you want:
#show table.cell: it => {
if it.x > 0 and it.y > 0 {
show "+": set text(green.darken(5%))
show $-$.body.text: set text(red.darken(15%))
show "0": set text(gray)
it
} else {
set text(blue.darken(20%))
it
}
}
#table(
columns: (auto, auto, 0pt, auto, 0pt, auto, 0pt, auto),
align: (x, y) => if y == 0 { center + bottom } else { center },
stroke: (x, y) => (
// Dash stroke inside
right: if x > 0 and y > 0 { (paint: black, dash: "dotted") },
// Left border
left: if y > 0 and x == 1 { black },
// Top border
top: if x > 0 and y == 1 { black },
rest: none),
$x$, [], $-oo$, [], $5$, [], $10$, [],
// Right border
table.vline(start: 1, stroke: (dash: none)),
$f$, $-$, [], $+$, [], $-$, [], $+$,
$g$, $+$, [0], $+$, [], $+$, [], $+$,
$h$, $-$, [], $+$, [], $-$, [], $+$,
$m$, $+$, [], $+$, [], $+$, [], $+$,
// Have to place bottom border manually
// to avoid having to somehow fetch the amount of rows
table.hline(start: 1, stroke: (dash: none))
)