我正在尝试让三个列居中,均匀分布在(相当长的)列标题下 (...)。有人能帮忙吗?谢谢!
\begin{table}[!]
\centering
\begin{tabular}{ c c c | c c c |c c c }
$Z$ & &$\Delta z$ [cm] & \multicolumn{3}{c}{$\langle dE/dX \rangle$ [MeV g$^{-1}$cm$^{2}$]} & \multicolumn{3}{|c}{$\Delta E$~[MeV]} \\
\hline
1 & LH$_{2}$ & $35$ & 5.10 &4.39 & 4.21 & 12.63 & 10.86 & 10.42 \\
\hline
& & $p_z$~[MeV/c] & 140 & 200 & 240 & 140 & 200 & 240\\
\hline
\hline
\end{tabular}
\label{tab:Targets}
\end{table}
答案1
您可以tabularx
按如下方式使用该包:
\documentclass{article}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\begin{document}
\begin{table}[htp]
\centering
\begin{tabularx}{\textwidth}{ c c c | C C C |c c c }
$Z$ & &$\Delta z$ [cm] & \multicolumn{3}{c}{$\langle dE/dX \rangle$ [MeV g$^{-1}$cm$^{2}$]} & \multicolumn{3}{|c}{$\Delta E$~[MeV]} \\
\hline
1 & LH$_{2}$ & $35$ & 5.10 &4.39 & 4.21 & 12.63 & 10.86 & 10.42 \\
\hline
& & $p_z$~[MeV/c] & 140 & 200 & 240 & 140 & 200 & 240\\
\hline \hline
\end{tabularx}
\label{tab:Targets}
\end{table}
\end{document}