答案1
与。{NiceTabular}
nicematrix
\documentclass{article}
\usepackage{nicematrix}
\usepackage{booktabs}
\begin{document}
\begin{NiceTabular}{cccccc}
\toprule
$n$ & Mean & Std. Dev. & \Block{1-3}{$p$ value between categories ($<0.05$)} \\
\midrule
166 & 3.04 & 0.96 & \Block{4-1}{$p=0.001$} \\
428 & 2.93 & 0.83 & & \Block{3-1}{$p=0.001$} \\
332 & 2.90 & 0.79 & & & \Block{2-1}{$p=0.022$} \\
216 & 2.69 & 0.86 \\
\midrule
$n$ & Mean & Std. Dev. & \Block{1-3}{$p$ value between categories ($<0.05$)} \\
\bottomrule
\CodeAfter
\SubMatrix{.}{2-1}{5-3}{\}}
\SubMatrix{.}{3-1}{5-4}{\}}
\SubMatrix{.}{4-1}{5-5}{\}}
\end{NiceTabular}
\end{document}
答案2
一些帮助你入门的东西
\documentclass{article}
\begin{document}
\begin{tabular}{cccc}
111&3.01&0.11&\\
222&2.02&0.21&\\
333&2.03&0.31&\\
444&1.04&0.41&
\smash{%
\raisebox{1.5\normalbaselineskip}{%
$\left\}\rule{0pt}{2\normalbaselineskip}\right. p=0.001$}%
\quad
\raisebox{1\normalbaselineskip}{%
$\left\}\rule{0pt}{1.5\normalbaselineskip}\right. p=0.002$}%
\quad
\raisebox{.5\normalbaselineskip}{%
$\left\}\rule{0pt}{1\normalbaselineskip}\right. p=0.003$}%
}\\
\end{tabular}
\end{document}