我有一张很长的表格(有 200 行),一页放不下。我曾尝试使用“longtable”,但收到错误消息,无法创建 pdf 文件。您能告诉我如何将 longtable 与 tabular 和 scalebox 结合使用吗?
提前谢谢了!
这是我尝试过的:
\begin{longtable}[H]\caption{\large{Title}}
\begin{center}
\scalebox{1.3}{
\begin{tabular}{lcc}\hline\hline
\textbf{County} & \textbf{N of obs} & \textbf{\%} \\
\hline
Lake1 & Observations & Percentage \\
Lake2 & Observations & Percentage \\
..
..
Lake200 & Observations & Percentage \\
\hline\hline
\end{tabular}
}
\end{center}
\end{longtable}
答案1
这是 xcorrect 代码的示例。我\hline
用 的规则替换了 s booktabs
,它有一些垂直填充并使表格看起来不那么紧凑,并且caption
包可以控制标题布局。
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{longtable}
\begin{document}
\null\vspace{0.72\textheight}
{\renewcommand{\arraystretch}{1.33}
\begin{longtable}{lcc}
\captionsetup{font={large}, labelfont=bf, skip=4pt}
\caption{Title} \\
\toprule\midrule
\textbf{County} & \textbf{N\textsuperscript{o} of obs} & \textbf{\%} \\
\midrule
\endfirsthead
\caption{Title (continued)}\\
\midrule
\textbf{County} & \textbf{N\textsuperscript{o} of obs} & \textbf{\%} \\
\midrule
\endhead
\midrule
\multicolumn{3}{r@{}}{\itshape To be continued}
\endfoot
\midrule\bottomrule
\endlastfoot
Lake1 & Observations & Percentage \\
Lake2 & Observations & Percentage \\
Lake Pipple-popple & Observations & Percentage \\
$\vdots$ & $\vdots$ & $\vdots$ \\
Lake197 & Observations & Percentage \\
Lake198 & Observations & Percentage \\
Lake199& Observations & Percentage \\
Lake200 & Observations & Percentage \\
\end{longtable}
}
\end{document}