![横向环境中表格的标题](https://linux22.com/image/345950/%E6%A8%AA%E5%90%91%E7%8E%AF%E5%A2%83%E4%B8%AD%E8%A1%A8%E6%A0%BC%E7%9A%84%E6%A0%87%E9%A2%98.png)
我想在横向环境中为表格插入标题,但找不到方法。
\begin{landscape}
\pagestyle{empty}%
\resizebox{0,1\textwidth}{!}{%
\begin{tabular}{|c|c|}
\hline
& \\
\hline
& \\
\hline
\end{tabular} }
\end{landscape}
答案1
您可以加载该rotating
包并利用其sidewaystable
环境以横向模式排版标题和表格材料。
\resizebox
哦,除非所有其他更合理的方法都已用尽,否则我不会采用该方法。
\documentclass{article}
\usepackage{rotating,graphicx}
\begin{document}
\begin{sidewaystable}
\caption{A table in landscape format}
\resizebox{\textwidth}{!}{%
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
abc & abc & abc & abc & abc & abc & abc & abc & abc & abc & abc &
abc & abc & abc & abc & abc & abc & abc & abc & abc & abc & abc \\
\hline
\end{tabular}%
} % end of scope of \resizebox
\end{sidewaystable}
\end{document}
答案2
也许需要一些例子来说明你问题评论中给出的建议。特别是,如果你使用David 建议的列类型,那么你可能根本p
不需要环境。landscape
\documentclass{article}
\usepackage{
lscape,
lipsum % just to obtain some filler text
}
\renewcommand{\arraystretch}{1.5}
\begin{document}
\pagestyle{empty}%
\begin{landscape}
\small
\begin{table}
\caption{Pokemons of the world}
\begin{tabular}{|p{0.5\linewidth}|p{0.5\linewidth}|}
\hline
Before & After \\
\hline
\lipsum[1-2] & \lipsum[2] \\
\hline
\end{tabular}
\end{table}
\end{landscape}
\begin{table}
\caption{Pokemons of the world}
\begin{tabular}{|p{0.7\linewidth}|p{0.3\linewidth}|}
\hline
Before & After \\
\hline
\lipsum[1-2] & \lipsum[2] \\
\hline
\end{tabular}
\end{table}
\end{document}