这是我的代码:
\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx,ragged2e,booktabs,caption}
\usepackage{tabu}
\begin{document}
\begin{center}
\begin{minipage}{\linewidth}
\begin{center}
\small
\begin{tabu}{|[2pt] >{\raggedright}m{5cm} |[2pt] >{\centering}m{0.7cm} | >{\centering} m{0.4cm} | >{\centering} m{0.9cm} | >{\centering} m{2cm}| >{\centering}m{1.9cm} | >{\centering}m{1.9cm} |[2pt]}
%\begin{tabu}{|[2pt] >{\centering}p{5cm} |[2pt] >{\centering}p{0.4cm} | >{\centering} p{0.4cm} | >{\centering} p{0.9cm} | >{\centering} p{2cm}| >{\centering}p{1.9cm} | >{\centering}p{1.9cm} |[2pt]}
\tabucline[2pt]{-}
\multirow{3}{*}{Statements}& \multicolumn{6}{c|[2pt]}{Test Value\,=\,3}\\
\cline{2-7}
& \multicolumn{4}{c}{} &\multicolumn{2}{|p{3.8cm}|[2pt]}{95\,\% Confidence Interval of the Difference} \rule{0pt}{4ex}\\[3ex]
\cline{2-7}
& M& TP& V-valu& Difference& Lower& Upper \\[3ex]
\tabucline[2pt]{-}
IIdentifying wertssdf sdfweds asdwead asdwedasd asdwedasd asdad pattern asdwsdva a s asdasd for comparing the same aweda against the afasd qweqw asdas asdasd..& 9.50& 33& .000& 1.1& .9& 1.4\\[12ex]
Identifying wertssdf sdfweds asdwead asdwedasd asdwedasd asdad pattern asdwsdva a s asdasd for comparing the same aweda against the afasd qweqw asdas asdasd.& 4.34& 31& .000& .7& .4& 1.0 \\[12ex]
Identifying wertssdf sdfweds asdwead asdwedasd asdwedasd asdad pattern asdwsdva a s asdasd for comparing the same aweda against the afasd qweqw asdas asdasd., is valuable knowledge.& 6.347& 31& .000& 1.1& .7& 1.4 \\[10ex]
DIdentifying wertssdf sdfweds asdwead asdwedasd asdwedasd asdad pattern asdwsdva a s asdasd for comparia against the afasd qweqw asdas asdasd. not .& 5.78& 30& .000& .9& .6& 1.2\\[14ex]
\tabucline[2pt]{-}
\end{tabu}
\end{center}
\end{minipage}
\end{center}
\end{document}
它看起来是这样的:
如您所见,第二行的第 5 列和第 6 列未对齐。为什么会这样?
我找不到任何错误?
先感谢您。
答案1
除第一列外,垂直标尺应始终位于列的右边缘,列左侧的标尺不会与下一行上一列右侧的标尺连接,因此
& \multicolumn{4}{c|}{} &\multicolumn{2}{p{3.8cm}|[2pt]}{95\,\% Confidence Interval of the Difference} \rule{0pt}{4ex}\\[3ex]
不是
& \multicolumn{4}{c}{} &\multicolumn{2}{|p{3.8cm}|[2pt]}{95\,\% Confidence Interval of the Difference} \rule{0pt}{4ex}\\[3ex]