I have copied what I wrote in LaTeX and I will also attach a picture of what I want to achieve.
Desired result:
What I wrote so far:
\begin{center}
\begin{tabular}{ |p{1.5cm}||p{1.5cm}|p{1.5cm}|p{1.5cm}||p{1.5cm}| }
\hline
\multicolumn{5}{|c|}{Lepton Classification} \\
\hline
$l$ & $Q$ & $L_e$ & $L_\mu$ & $L_\tau$\\
\hline
$e$ & -1 & 1 & 0 & 0 \\
$\nu_e$ & 0 & 1 & 0 & 0\\
\hline
$\mu$ & -1 & 0 & 1 & 0 \\
$\nu_\mu$ & 0 & 0 & 1 & 0\\
\hline
$\tau$ & -1 & 0 & 0 & 1 \\
$\nu_\tau$ & 0 & 0 & 0 & 1\\
\hline
\end{tabular}
\end{center}
I looked up several posts. However, I could not adjust the solutions to my problem.
Best Answer
Here is a way to do that with
{NiceTabular}
ofnicematrix
.You need several compilations (because
nicematrix
uses PGF/Tikz nodes under the hood).