![乳胶中的表格居中](https://linux22.com/image/261453/%E4%B9%B3%E8%83%B6%E4%B8%AD%E7%9A%84%E8%A1%A8%E6%A0%BC%E5%B1%85%E4%B8%AD.png)
我创建了一个表格,但它有点向右倾斜。有什么办法可以修复它吗?代码如下:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{lllllll}
\toprule
\multicolumn{1}{l}{Parameters} &
\multicolumn{2}{c}{Model $A$} &
\multicolumn{2}{c}{Model $B$} \\
\cmidrule(lr){2-3}
\cmidrule(lr){4-5}
&
\multicolumn{1}{c}{Coefficient} &
\multicolumn{1}{c}{95\% Bayesian Interval} &
\multicolumn{1}{c}{Coefficient} &
\multicolumn{1}{c}{95\% Bayesian Interval} \\
\midrule
concern &0.006 & ( -0.036, 0.047) & 0.010 & (-0.029,0.050) \\
\bottomrule
\end{tabular}
\end{document}
答案1
最简单的解决方法是在标题中再添加一行:
笔记:
- 您确实应该对数字使用数学模式——如果数字是负数,这一点尤其重要,因为否则数字无法正确显示。请注意不使用数学模式时负数的显示方式:
代码:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent
\begin{tabular}{lllllll}
\toprule
\multicolumn{1}{l}{Parameters} &
\multicolumn{2}{c}{Model $A$} &
\multicolumn{2}{c}{Model $B$} \\
\cmidrule(lr){2-3}
\cmidrule(lr){4-5}
&
\multicolumn{1}{c}{} &
\multicolumn{1}{c}{95\% Bayesian} &
\multicolumn{1}{c}{Coefficient} &
\multicolumn{1}{c}{95\% Bayesian} \\
&
\multicolumn{1}{c}{Coefficient} &
\multicolumn{1}{c}{Interval} &
\multicolumn{1}{c}{Coefficient} &
\multicolumn{1}{c}{Interval} \\\midrule
concern &0.006 & $( -0.036, 0.047)$ & 0.010 & $(-0.029,0.050)$ \\
\bottomrule
\end{tabular}
\end{document}