表格中的线条不知何故在中间停止了。任何建议都将不胜感激!
\documentclass[11pt,a4paper]{book}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\begin{table*}
\begin{tabularx}{\textwidth}{@{}lcccccccccccr@{}}
\toprule
& Control& & & Low Input & & & Medium Input & & & High Input & & \\
& Mean & SD & N & Mean & SD & N & Mean & SD & N & Mean & SD & N \\
\midrule
Fillers posttest I & 78.0 & 6.58 & 20 & 84.1 & 10.1 & 48 & 86.2 & 10.9 & 46 & 84.0 & 11.5 & 21 \\
Fillers posttest II & 86.1 & 9.41 & 20 & 91.2 & 9.5 & 48 & 95.3 & 7.71 & 46 & 90.5 & 8.25 & 21 \\
Plural Nouns posttest I & 50.8 & 17.0 & 20 & 50.3 & 18.2 & 48 & 55.0 & 17.7 & 46 & 60.0 & 23.9 & 21 \\
Plural Nouns posttest II & 55.5 & 26.9 & 20 & 56.3 & 19.3 & 48 & 62.6 & 22.4 & 46 & 61.9 & 20.9 & 21 \\
Present Simple posttest I & 36.4 & 12.5 & 20 & 40.3 & 19.5 & 48 & 39.7 & 18.9 & 46 & 32.3 & 15.7 & 21 \\
Present Simple posttest II & 25.1 & 23.3 & 20 & 27.8 & 18.0 & 48 & 23.5 & 17.5 & 46 & 38.6 & 19.2 & 21 \\
Present Progressive posttest I & 36.0 & 20.5 & 20 & 41.4 & 18.7 & 48 & 41.0 & 16.8 & 46 & 40.5 & 17.3 & 21 \\
Present Progressive posttest II& 30.4 & 26.7 & 20 & 28.5 & 18.7 & 48 & 26.1 & 19.8 & 46 & 33.8 & 24.7 & 21 \\
\bottomrule
\end{tabularx}
\end{table*}
\end{landscape}
\end{document}
答案1
你有两个问题:
textwidth
方向landscape
与 相同portrait˛
。所以线很长textwidth
- 如果你使用
tabularx
至少一个列,必须是类型X
如果你用以下方式替换行
\begin{tabularx}{\textwidth}{@{}lcccccccccccr@{}}
宽度例如
\begin{tabularx}{\hsize}{@{}Xcccccccccccr@{}}
或更短:
\begin{tabularx}{\hsize}{@{}X*{11}{c}r@{}}
表格将会变成你预期的样子(我猜)。我得到:
为了在第一列的每一行中只有一行,您需要调整列间距或重新格式化列标题Medium Input
或Height Input
使表格稍微宽一些,例如对于宽度使用1.05\hsize
。
附录: 两年半之后我再次看到你的表格......现在在我看来,你对表格的以下重新设计实际上是有意义的:
\documentclass[11pt,a4paper]{book}
\usepackage{pdflscape}
\usepackage{booktabs, tabularx}
\newcommand\mccc[1]{\multicolumn{3}{c}{#1}}% <-- added
\begin{document}
\begin{landscape}
\begin{table}
\setlength\tabcolsep{9pt}
\begin{tabularx}{\linewidth}{@{}X*{12}{c}@{}}<-- changed
\toprule
& \mccc{Control} & \mccc{Low Input} & \mccc{Medium Input} & \mccc{High Input} \\
\cmidrule(lr){2-4} % <-- added
\cmidrule(lr){5-7} % <-- added
\cmidrule(lr){8-10} % <-- added
\cmidrule(lr){11-13}% <-- added
& Mean & SD & N & Mean & SD & N & Mean & SD & N & Mean & SD & N \\
\midrule
Fillers posttest I
& 78.0 & 6.58 & 20 & 84.1 & 10.1 & 48 & 86.2 & 10.9 & 46 & 84.0 & 11.5 & 21 \\
Fillers posttest II
& 86.1 & 9.41 & 20 & 91.2 & 9.5 & 48 & 95.3 & 7.71 & 46 & 90.5 & 8.25 & 21 \\
Plural Nouns posttest I
& 50.8 & 17.0 & 20 & 50.3 & 18.2 & 48 & 55.0 & 17.7 & 46 & 60.0 & 23.9 & 21 \\
Plural Nouns posttest II
& 55.5 & 26.9 & 20 & 56.3 & 19.3 & 48 & 62.6 & 22.4 & 46 & 61.9 & 20.9 & 21 \\
Present Simple posttest I
& 36.4 & 12.5 & 20 & 40.3 & 19.5 & 48 & 39.7 & 18.9 & 46 & 32.3 & 15.7 & 21 \\
Present Simple posttest II
& 25.1 & 23.3 & 20 & 27.8 & 18.0 & 48 & 23.5 & 17.5 & 46 & 38.6 & 19.2 & 21 \\
Present Progressive posttest I
& 36.0 & 20.5 & 20 & 41.4 & 18.7 & 48 & 41.0 & 16.8 & 46 & 40.5 & 17.3 & 21 \\
Present Progressive posttest II
& 30.4 & 26.7 & 20 & 28.5 & 18.7 & 48 & 26.1 & 19.8 & 46 & 33.8 & 24.7 & 21 \\
\bottomrule
\end{tabularx}
\end{table}
\end{landscape}
\end{document}
答案2
\documentclass[11pt,a4paper]{book}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\renewcommand{\tabcolsep}{5pt}
\begin{table*}
\begin{tabularx}{\linewidth}{@{}X*{11}cr@{}}
\toprule
& Control& & & Low Input & & & Medium Input & & & High Input & & \\
& Mean & SD & N & Mean & SD & N & Mean & SD & N & Mean & SD & N \\
\midrule
Fillers posttest I & 78.0 & 6.58 & 20 & 84.1 & 10.1 & 48 & 86.2 & 10.9 & 46 & 84.0 & 11.5 & 21 \\
Fillers posttest II & 86.1 & 9.41 & 20 & 91.2 & 9.5 & 48 & 95.3 & 7.71 & 46 & 90.5 & 8.25 & 21 \\
Plural Nouns posttest I & 50.8 & 17.0 & 20 & 50.3 & 18.2 & 48 & 55.0 & 17.7 & 46 & 60.0 & 23.9 & 21 \\
Plural Nouns posttest II & 55.5 & 26.9 & 20 & 56.3 & 19.3 & 48 & 62.6 & 22.4 & 46 & 61.9 & 20.9 & 21 \\
Present Simple posttest I & 36.4 & 12.5 & 20 & 40.3 & 19.5 & 48 & 39.7 & 18.9 & 46 & 32.3 & 15.7 & 21 \\
Present Simple posttest II & 25.1 & 23.3 & 20 & 27.8 & 18.0 & 48 & 23.5 & 17.5 & 46 & 38.6 & 19.2 & 21 \\
Present Progressive posttest I & 36.0 & 20.5 & 20 & 41.4 & 18.7 & 48 & 41.0 & 16.8 & 46 & 40.5 & 17.3 & 21 \\
Present Progressive posttest II& 30.4 & 26.7 & 20 & 28.5 & 18.7 & 48 & 26.1 & 19.8 & 46 & 33.8 & 24.7 & 21 \\
\bottomrule
\end{tabularx}
\end{table*}
\end{landscape}
\end{document}
首先,\textwidth
用替换,\linewidth
因为\textwidth
横向和纵向相同(@Zakro 也提到了)。
其次,您的表格仅比 宽约\linewidth
。25pt
列数为13
,应为26\tabcolsep
减2\tabcolsep
,这是由于两个@{}
。因此,我们可以将 缩小\tabcolsep
(1pt
甚至不会引人注意)到原始宽度。这将使我们的24pt
宽度增加约 。最后,使用至少一个符合X
规范的列,然后您的表格就可以适合,不会出现任何错误或警告。