想问一下,下面的表格如何按小数点和等号分别对齐啊?红色椭圆所示
下面是代码:
\documentclass{ctexbook}
\usepackage{booktabs}
\usepackage{multirow}
\usepackage{amsmath}
\begin{document}
\begin{center}
\begin{tabular*}{\textwidth}{c@{\extracolsep{\fill}}cc}
\toprule
序号 & 第1列 & 第2列\tabularnewline
\midrule
\multirow{2}*{2} & $\dfrac{1}{\sqrt{3}}=0.577~350~269 2$ & 1\tabularnewline
& $-\dfrac{1}{\sqrt{3}}=-0.577~350~269 2$ & 1\tabularnewline
\midrule
\multirow{3}*{3} & $-\left(\dfrac{3}{5}\right)^{1/2}=-0.774~596~669 2$ & $\dfrac{5}{9}=0.555~555~555 6$\tabularnewline
& 0.0 & $\dfrac{8}{9}=0.888~888~888~9$\tabularnewline
& $\left(\dfrac{3}{5}\right)^{1/2}=0.774~596~669~2$ & $\dfrac{5}{9}=0.555~555~555~6$\tabularnewline
\midrule
\multirow{4}*{4} & 0.861~136~311~6 & 0.347~854~845 1\tabularnewline
& 0.339~981~043~6 & 0.652~145~154~9\tabularnewline
& $-$0.339~981~043~6 & 0.652~145~154~9\tabularnewline
& $-$0.861~136~311~6 & 0.347~854~845~1\tabularnewline
\midrule
\multirow{5}*{5} & 0.906 179 845 9 & 0.236 926 885 0\tabularnewline
&0.538 469 310 1 & 0.478 628 670 5\tabularnewline
& 0.0 & 0.568 888 888 9\tabularnewline
& $-$0.538 469 310 1 & 0.478 628 670 5\tabularnewline
& $-$0.906 179 845 9 & 0.236 926 885 0\tabularnewline
\bottomrule
\end{tabular*}
\end{center}
\end{document}
另外,使用multirow宏包,序号2和3的垂直对齐也不理想,是我用错了吗?
感激!
大错特错,这代码是真的 Shit mountain……
siunitx
宏包的 \num
@{.}
+对齐达到,或者 dcolumn
宏包aligned
有具体实现吗?不是太懂。。
@u26098 建议你去淘宝店