With nicematrix, you can write a command \Cross to use in each row you want to cross. You will be able to use that command in the environments of nicematrix ({NiceTabular}, {pNiceMatrix}, etc.) which are similar to the classical environments (of the packages array and amsmath).
\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}
\ExplSyntaxOn
\NewDocumentCommand { \Cross } { }
{
\tl_gput_right:Nx \g_nicematrix_code_after_tl
{ __pantigny_cross:n { \int_use:c { c@iRow } } }
}
\cs_new_protected:Nn __pantigny_cross:n
{
\tikz
\draw [red, shorten~> = -3pt, shorten~< = -3pt]
( #1-1-medium .west ) -- ( #1- \int_use:c { c@jCol } - medium .east ) ;
}
\ExplSyntaxOff
\begin{document}
\begin{NiceTabular}{cccc}[create-medium-nodes]
$p$ & $q$ & $r$ & $f$ \
\hline
0 & 0 & 0 & 0 \Cross \
0 & 0 & 1 & 1 \
0 & 1 & 0 & 1 \
0 & 1 & 1 & 0 \Cross \
1 & 0 & 0 & 0 \
1 & 1 & 0 & 0 \
1 & 1 & 1 & 1
\end{NiceTabular}
\end{document}
The use of the medium nodes ensures horizontal lines.
We have to compile several times (because nicematrix uses PGF/Tikz nodes).
