Quantcast
Viewing latest article 4
Browse Latest Browse All 4

Answer by F. Pantigny for Putting a vertical line through text in a table

Here is a solution with {NiceTabular} on nicematrix. The dashed rules are drawn with TikZ by using the Tikz nodes created under the cells, rows and columns by nicematrix.

\documentclass{article}\usepackage{nicematrix,tikz}\begin{document}\begin{NiceTabular}{>{\itshape}cccc}[hvlines]  \RowStyle{\itshape}& Dig & Weed & Cut \\  Boris    & 50  & 0    & 50  \\  Percival & 20  & 0    & 30  \\  Spike    &  0  & 0    & 0 \CodeAfter  \tikz \draw [dashed,red] (4.5-|1) -- (4.5-|last) (1-|3.5) -- (last-|3.5) ; \end{NiceTabular}\end{document}

You need several compilations.

Image may be NSFW.
Clik here to view.
Output of the above code


Viewing latest article 4
Browse Latest Browse All 4

Trending Articles