How to make three little curly braces for this table

bracketsmultirowtables

I have copied what I wrote in LaTeX and I will also attach a picture of what I want to achieve.

Desired result:

Image

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} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\begin{center}
\begin{NiceTabular}{ccccc}[first-row,first-col,vlines,cell-space-limits=3pt]
  & \Block{1-5}{Lepton Classification} \\ \Hline
\RowStyle[bold]{}
  & $l$ & $Q$ & $L_e$ & $L_\mu$ & $L_\tau$ \\ \Hline
\Block[l]{2-1}{First generation\hspace*{3mm}}
  & $e$  & -1 & 1 & 0 & 0 \\
  & $\nu_e$ & 0 & 1 & 0 & 0 \\ \Hline
\Block[l]{2-1}{Second generation\hspace*{3mm}}
  & $\mu$ & -1 & 0 & 1 & 0 \\
  & $\nu_\mu$ & 0  & 0 & 1 & 0 \\ \Hline
\Block[l]{2-1}{Third generation\hspace*{3mm}}
  & $\tau$ & -1 & 0 & 0 & 1 \\
  & $\nu_\tau$ & 0  & 0 & 0 & 1 \\ \Hline
\CodeAfter [sub-matrix/left-xshift=2.5mm,sub-matrix/extra-height=-4pt]
  \SubMatrix{\lbrace}{2-1}{3-1}{.}
  \SubMatrix{\lbrace}{4-1}{5-1}{.}
  \SubMatrix{\lbrace}{6-1}{7-1}{.}
\end{NiceTabular}
\end{center} 

\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

Related Question