How to hide the right stroke of a single table cell (not the entire column)?

Hello Typst Community,

I’m trying to achieve a specific styling for a table in Typst and I’m looking for the best way to hide the right border (stroke) of only a specific cell, without affecting the rest of the column’s borders.

Here’s a simplified example of my table:

#table(
  columns: (auto, auto, auto),
  inset: 10pt,
  align: horizon,
  table.cell(stroke: none,)[col 1],[col 2], [col 3],
  [c1 r1],[c2 r2], [c3 r3]
)

Hello, you need to set the border to none for both the right side of the first cell and the left side of the second cell. To do this, stroke can accept a dictionary where you specify sides such as left, top, right, bottom, x, y and rest.

#table(
  columns: (auto, auto, auto),
  inset: 10pt,
  align: horizon,
  table.cell(stroke: (right: none))[col 1],table.cell(stroke: (left: none),)[col 2], [col 3],
  [c1 r1],[c2 r2], [c3 r3]
)

An alternative would be to use vline.

#table(
  columns: (auto, auto, auto),
  inset: 10pt,
  align: horizon,
  table.vline(stroke: none, x: 1, start: 0, end: 1),
  [col 1],[col 2], [col 3],
  [c1 r1],[c2 r2], [c3 r3]
)

3 Likes

Thank you :blush:, that was exactly what I needed!