An tabularray
example in case a tabularray
equivalence is called for (actually already wanted once in lvjr/tabularray#451
).
Note the similarly defined H
column type doesn't work with vlines
inner key.
Theoretically tabularray
could do better. As the table body (aka. environment content) is split and then stored in a per-cell basis before typesetting, there's indeed an internal state at that time one can truly manipulate the table structurally. But then all references to row and column numbers are suffering from a mapping.
\documentclass{article}
\usepackage{tabularray}
\NewColumnType{H}{Q[cmd={\setbox0=\vbox}, colsep=0pt]}
\begin{document}
\setlength{\rulewidth}{3pt} % enlarge \rulewidth to emphasis the difference
\begin{tblr}{
hlines, vline{1,Z},
colspec={lHl}
}
One & Hide & Two \\
One & XXXX & Two \\
\end{tblr}
\begin{tblr}{
hlines, vline{1,Z},
colspec={ll}
}
One & Two \\
One & Two \\
\end{tblr}
\end{document}
