我有附加的表格,但我无法将其固定到页面上...您建议我怎么做?
\begin{sidewaystable}[ht]
\centering
\begin{tabularx}{\textwidth}{P{2.5cm}lrrrrrrrrrr}
% \toprule
\hline
& Momento & CD.Oeste & CD.Norte & CD.Este & CD.Sur & ONU.Chileno & ONU.Latinoamericano & ONU.Lejano.Este & ONU.Sur.Asia & ONU.General \\
\hline
1898 & 40.68 & 45.79 & 45.88 & 45.12 & 45.75 & 47.12 & 46.36 & 47.66 & 46.03 & 46.75 \\
1903 & 42.15 & 47.47 & 47.56 & 46.83 & 47.53 & 48.96 & 48.17 & 49.61 & 47.77 & 48.60 \\
1908 & 43.67 & 49.22 & 49.32 & 48.64 & 49.38 & 50.88 & 50.05 & 51.62 & 49.58 & 50.52 \\
1913 & 45.25 & 51.08 & 51.18 & 50.54 & 51.31 & 52.85 & 51.99 & 53.71 & 51.45 & 52.52 \\
1918 & 46.88 & 53.05 & 53.16 & 52.54 & 53.32 & 54.89 & 54.00 & 55.87 & 53.39 & 54.58 \\
1923 & 48.54 & 55.15 & 55.27 & 54.64 & 55.40 & 56.97 & 56.06 & 58.08 & 55.39 & 56.70 \\
1928 & 50.24 & 57.38 & 57.43 & 56.82 & 57.54 & 59.09 & 58.17 & 60.34 & 57.44 & 58.87 \\
1933 & 51.97 & 59.66 & 59.64 & 59.07 & 59.72 & 61.23 & 60.31 & 62.61 & 59.51 & 61.07 \\
1938 & 53.72 & 61.98 & 61.88 & 61.38 & 61.93 & 63.37 & 62.46 & 64.88 & 61.60 & 63.28 \\
1943 & 55.48 & 64.34 & 64.13 & 63.72 & 64.13 & 65.50 & 64.60 & 67.13 & 63.68 & 65.48 \\
1948 & 57.24 & 66.70 & 66.37 & 66.08 & 66.32 & 67.59 & 66.71 & 69.31 & 65.75 & 67.64 \\
1953 & 59.00 & 69.04 & 68.57 & 68.42 & 68.45 & 69.62 & 68.78 & 71.41 & 67.78 & 69.74 \\
1958 & 60.74 & 71.32 & 70.73 & 70.73 & 70.52 & 71.59 & 70.78 & 73.42 & 69.76 & 71.77 \\
1963 & 62.46 & 73.51 & 72.82 & 72.97 & 72.50 & 73.47 & 72.70 & 75.30 & 71.67 & 73.71 \\
1968 & 64.16 & 75.58 & 74.82 & 75.10 & 74.35 & 75.23 & 74.52 & 77.04 & 73.49 & 75.52 \\
1973 & 65.81 & 77.52 & 76.72 & 77.08 & 76.10 & 76.89 & 76.23 & 78.66 & 75.23 & 77.22 \\
1978 & 67.43 & 79.28 & 78.47 & 78.90 & 77.72 & 78.42 & 77.82 & 80.11 & 76.84 & 78.78 \\
1983 & 68.99 & 80.86 & 80.07 & 80.52 & 79.23 & 79.85 & 79.30 & 81.44 & 78.37 & 80.22 \\
1988 & 70.51 & 82.23 & 81.46 & 81.94 & 80.59 & 81.13 & 80.63 & 82.61 & 79.75 & 81.51 \\
1993 & 71.96 & 83.43 & 82.69 & 83.21 & 81.84 & 82.31 & 81.87 & 83.68 & 81.03 & 82.69 \\
1998 & 73.36 & 84.46 & 83.73 & 84.29 & 82.95 & 83.36 & 82.97 & 84.60 & 82.18 & 83.72 \\
% \bottomrule
\hline
\end{tabularx}
\end{sidewaystable}
答案1
sidewaystable
如果你有多行列标题makecell
并且表格使用较小的字体大小,那么你实际上并不需要使用它:
\documentclass[letterpaper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[showframe]{geometry}
\usepackage{caption, array, makecell, booktabs}
\begin{document}
\begin{table}[!htb]
\caption{My nice little caption}
\centering\small
\setlength\tabcolsep{4pt}
\begin{tabular}{l*{10}{c}}
\toprule
& \thead{Momento} & \thead{CD.\\Oeste} & \thead{CD.\\Norte} & \thead{CD.\\Este} & \thead{CD.\\Sur} & \thead{ONU.\\Chileno} & \thead{ONU.\\Latino\\americano} & \thead{ONU.\\Lejano.\\Este} & \thead{ONU.\\Sur.\\Asia} & \thead{ONU.\\General} \\
\midrule
1898 & 40.68 & 45.79 & 45.88 & 45.12 & 45.75 & 47.12 & 46.36 & 47.66 & 46.03 & 46.75 \\
1903 & 42.15 & 47.47 & 47.56 & 46.83 & 47.53 & 48.96 & 48.17 & 49.61 & 47.77 & 48.60 \\
1908 & 43.67 & 49.22 & 49.32 & 48.64 & 49.38 & 50.88 & 50.05 & 51.62 & 49.58 & 50.52 \\
1913 & 45.25 & 51.08 & 51.18 & 50.54 & 51.31 & 52.85 & 51.99 & 53.71 & 51.45 & 52.52 \\
1918 & 46.88 & 53.05 & 53.16 & 52.54 & 53.32 & 54.89 & 54.00 & 55.87 & 53.39 & 54.58 \\
1923 & 48.54 & 55.15 & 55.27 & 54.64 & 55.40 & 56.97 & 56.06 & 58.08 & 55.39 & 56.70 \\
1928 & 50.24 & 57.38 & 57.43 & 56.82 & 57.54 & 59.09 & 58.17 & 60.34 & 57.44 & 58.87 \\
1933 & 51.97 & 59.66 & 59.64 & 59.07 & 59.72 & 61.23 & 60.31 & 62.61 & 59.51 & 61.07 \\
1938 & 53.72 & 61.98 & 61.88 & 61.38 & 61.93 & 63.37 & 62.46 & 64.88 & 61.60 & 63.28 \\
1943 & 55.48 & 64.34 & 64.13 & 63.72 & 64.13 & 65.50 & 64.60 & 67.13 & 63.68 & 65.48 \\
1948 & 57.24 & 66.70 & 66.37 & 66.08 & 66.32 & 67.59 & 66.71 & 69.31 & 65.75 & 67.64 \\
1953 & 59.00 & 69.04 & 68.57 & 68.42 & 68.45 & 69.62 & 68.78 & 71.41 & 67.78 & 69.74 \\
1958 & 60.74 & 71.32 & 70.73 & 70.73 & 70.52 & 71.59 & 70.78 & 73.42 & 69.76 & 71.77 \\
1963 & 62.46 & 73.51 & 72.82 & 72.97 & 72.50 & 73.47 & 72.70 & 75.30 & 71.67 & 73.71 \\
1968 & 64.16 & 75.58 & 74.82 & 75.10 & 74.35 & 75.23 & 74.52 & 77.04 & 73.49 & 75.52 \\
1973 & 65.81 & 77.52 & 76.72 & 77.08 & 76.10 & 76.89 & 76.23 & 78.66 & 75.23 & 77.22 \\
1978 & 67.43 & 79.28 & 78.47 & 78.90 & 77.72 & 78.42 & 77.82 & 80.11 & 76.84 & 78.78 \\
1983 & 68.99 & 80.86 & 80.07 & 80.52 & 79.23 & 79.85 & 79.30 & 81.44 & 78.37 & 80.22 \\
1988 & 70.51 & 82.23 & 81.46 & 81.94 & 80.59 & 81.13 & 80.63 & 82.61 & 79.75 & 81.51 \\
1993 & 71.96 & 83.43 & 82.69 & 83.21 & 81.84 & 82.31 & 81.87 & 83.68 & 81.03 & 82.69 \\
1998 & 73.36 & 84.46 & 83.73 & 84.29 & 82.95 & 83.36 & 82.97 & 84.60 & 82.18 & 83.72 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
答案2
为了使表格内容有机会适合文本块的宽度(即使旋转到横向模式),有必要在几个标题单元格中引入换行符。为此,我建议您对第一列使用普通l
列类型(而不是),对十个数据列使用P{...}
居中版本的X
列类型(而不是)。r
我还想建议您进一步组织表格标题,以突出显示前四列数据是关于“CD”的,后六列数据是关于“ONU”的。在单词“Latinoamericano”中添加一个自由连字符(即,将其写为“ Latino\-americano
”)可以产生换行符。最后,为了帮助您的读者解析和理解表格中的材料,在数据的每个第五行之后添加一些垂直空格可能会有所帮助。
\documentclass{article}
\usepackage[spanish]{babel}
\usepackage{rotating,tabularx,booktabs,caption}
\newcolumntype{C}{>{\centering\arraybackslash}X} % centered version of "X" column
\begin{document}
\begin{sidewaystable}
\caption{[table caption here]}
\label{tab:some_table}
\begin{tabularx}{\textwidth}{@{} l*{10}{C} @{}}
\toprule
& \multicolumn{4}{c}{CD} & \multicolumn{6}{c@{}}{ONU} \\
\cmidrule(lr){2-5} \cmidrule(l){6-11}
& Momento & Oeste & Norte & Este & Sur & Chileno & Latino\-americano & Lejano Este & Sur Asia & General \\
\midrule
1898 & 40.68 & 45.79 & 45.88 & 45.12 & 45.75 & 47.12 & 46.36 & 47.66 & 46.03 & 46.75 \\
1903 & 42.15 & 47.47 & 47.56 & 46.83 & 47.53 & 48.96 & 48.17 & 49.61 & 47.77 & 48.60 \\
1908 & 43.67 & 49.22 & 49.32 & 48.64 & 49.38 & 50.88 & 50.05 & 51.62 & 49.58 & 50.52 \\
1913 & 45.25 & 51.08 & 51.18 & 50.54 & 51.31 & 52.85 & 51.99 & 53.71 & 51.45 & 52.52 \\
1918 & 46.88 & 53.05 & 53.16 & 52.54 & 53.32 & 54.89 & 54.00 & 55.87 & 53.39 & 54.58 \\
\addlinespace
1923 & 48.54 & 55.15 & 55.27 & 54.64 & 55.40 & 56.97 & 56.06 & 58.08 & 55.39 & 56.70 \\
1928 & 50.24 & 57.38 & 57.43 & 56.82 & 57.54 & 59.09 & 58.17 & 60.34 & 57.44 & 58.87 \\
1933 & 51.97 & 59.66 & 59.64 & 59.07 & 59.72 & 61.23 & 60.31 & 62.61 & 59.51 & 61.07 \\
1938 & 53.72 & 61.98 & 61.88 & 61.38 & 61.93 & 63.37 & 62.46 & 64.88 & 61.60 & 63.28 \\
1943 & 55.48 & 64.34 & 64.13 & 63.72 & 64.13 & 65.50 & 64.60 & 67.13 & 63.68 & 65.48 \\
\addlinespace
1948 & 57.24 & 66.70 & 66.37 & 66.08 & 66.32 & 67.59 & 66.71 & 69.31 & 65.75 & 67.64 \\
1953 & 59.00 & 69.04 & 68.57 & 68.42 & 68.45 & 69.62 & 68.78 & 71.41 & 67.78 & 69.74 \\
1958 & 60.74 & 71.32 & 70.73 & 70.73 & 70.52 & 71.59 & 70.78 & 73.42 & 69.76 & 71.77 \\
1963 & 62.46 & 73.51 & 72.82 & 72.97 & 72.50 & 73.47 & 72.70 & 75.30 & 71.67 & 73.71 \\
1968 & 64.16 & 75.58 & 74.82 & 75.10 & 74.35 & 75.23 & 74.52 & 77.04 & 73.49 & 75.52 \\
\addlinespace
1973 & 65.81 & 77.52 & 76.72 & 77.08 & 76.10 & 76.89 & 76.23 & 78.66 & 75.23 & 77.22 \\
1978 & 67.43 & 79.28 & 78.47 & 78.90 & 77.72 & 78.42 & 77.82 & 80.11 & 76.84 & 78.78 \\
1983 & 68.99 & 80.86 & 80.07 & 80.52 & 79.23 & 79.85 & 79.30 & 81.44 & 78.37 & 80.22 \\
1988 & 70.51 & 82.23 & 81.46 & 81.94 & 80.59 & 81.13 & 80.63 & 82.61 & 79.75 & 81.51 \\
1993 & 71.96 & 83.43 & 82.69 & 83.21 & 81.84 & 82.31 & 81.87 & 83.68 & 81.03 & 82.69 \\
1998 & 73.36 & 84.46 & 83.73 & 84.29 & 82.95 & 83.36 & 82.97 & 84.60 & 82.18 & 83.72 \\
\bottomrule
\end{tabularx}
\end{sidewaystable}
\end{document}