Estoy intentando alinear el encabezado de esta tabla sin éxito hasta el momento. ¿Alguien puede decirme qué estoy haciendo mal, por favor?
\documentclass[a4paper,12pt]{report}
\usepackage{multirow}
\usepackage{siunitx,booktabs}%for table decimals number
\usepackage[export]{adjustbox}
\begin{document}
\begin{table}[!htbp]
\centering
\begin{tabular}{p{2cm}p{2cm}p{2cm}}
\toprule
\multicolumn{1}{l}{\textbf{Res.}}
& \multicolumn{1}{l}{\textbf{$\boldsymbol{\beta}$}}
& \multicolumn{1}{c}{\textbf{$\boldsymbol{\chi^{2}}$}} \\
\midrule
\textbf{1} & -0.61$\pm$0.32 & 9.1$\times$10$^{7}$\\
\textbf{2} & -0.37$\pm$0.12 & 2.5$\times$10$^{6}$\\
\textbf{3} & -0.39$\pm$0.19 & 1.0$\times$10$^{7}$\\
\textbf{4} & -0.14$\pm$0.13 & 8.0$\times$10$^{6}$\\
\textbf{5} & -0.10$\pm$0.12 & 2.3$\times$10$^{6}$\\
\textbf{6} & -0.44$\pm$0.13 & 1.8$\times$10$^{6}$\\
\textbf{7} & -0.55$\pm$0.16 & 2.0$\times$10$^{6}$\\
\textbf{8a} & -0.54$\pm$0.16 & 1.9$\times$10$^{6}$\\
\bottomrule
\end{tabular}
\caption[$\beta$ results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV]{The $\beta$ parameter results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV.}
\label{table:120}
\end{table}
\end{document}
Respuesta1
¿Como esto?
Sugiero utilizar siunitx
el paquete. El uso de su tipo de columna S
y su forma de escribir números simplifica significativamente el código de su tabla:
\documentclass{article}
\usepackage{amsmath, amssymb}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[!htbp]
\sisetup{separate-uncertainty}%
\centering
\begin{tabular}{>{\bfseries}l
S[table-format=-1.2(2)]
S[table-format=-1.1e1]
}
\toprule
Res. & {$\boldsymbol{\beta}$} & {$\boldsymbol{\chi^{2}}$} \\
\midrule
1 & -0.61(32) & 9.1e7 \\
2 & -0.37(12) & 2.5e6 \\
3 & -0.39(19) & 1.0e7 \\
4 & -0.14(13) & 8.0e6 \\
5 & -0.10(12) & 2.3e6 \\
6 & -0.44(13) & 1.8e6 \\
7 & -0.55(16) & 2.0e6 \\
8a & -0.54(16) & 1.9e6 \\
\bottomrule
\end{tabular}
\caption[$\beta$ results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV]{The $\beta$ parameter results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV.}
\label{table:120}
\end{table}
\end{document}
Si desea que la segunda y tercera columna sean más anchas, puede prescribir su ancho de manera similar a como lo hace en el p{...}
tipo de columnas: sisetup
agregue el ancho deseado de la columna como:
\sisetup{separate-uncertainty,
table-column-width = 22mm}%
En este caso la tabla se convierte en:
Respuesta2
Si desea alinear números en una tabla, usesiunitx
. Le sugiero que consulte la documentación, en particular los §§ 3.6 y 5.14,material tabular.
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage{cellspace}
\setlength{\cellspacetoplimit}{6pt}
\setlength{\cellspacebottomlimit}{6pt}
\usepackage{makecell}
\newcommand*{\topdblline}{\Xhline{0.15ex}\\[-2.6ex]\hline}
\newcommand*{\botdblline}{\hline\\[-2.6ex]\Xhline{0.15ex}}
\begin{document}
\begin{table}[!htbp]
\centering\sisetup{separate-uncertainty, table-figures-uncertainty =2}
\begin{tabular}{ > {\bfseries}lS[table-format =-1.2(2)]S[table-figures-exponent =1]} \toprule
\multicolumn{1}{l}{Res.}
&{$ \boldsymbol{\beta} $} & {$\boldsymbol{\chi^{2}}$} \\%
\midrule%
1 & -0.61(32) & 9.1e7\\%
2 & -0.37(12) & 2.5e6\\%
3 & -0.39(19) & 1.0e7\\%
4 & -0.14(13) & 8.0e6\\%
5 & -0.10(12) & 2.3e6\\%
6 & -0.44(13)& 1.8e6\\%
7 & -0.55(16) & 2.0e6 \\%
8a & -0.54(16) & 1.9e6\\%
\bottomrule
\end{tabular}
\caption[$\beta$ results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV]{The $\beta$ parameter results measured in this work for the 3d $Mg^{+}$ in the $hv$ range between 54.50 and 57.45 eV.}
\label{table:120}
\end{table}
\end{document}