我有一个 table 环境,里面有一个 tabular 环境,我想把标题放在它的右侧(表格足够窄),而不是放在它下面。这怎么可能呢?
答案1
您可以使用floatrow
包;一个小例子:
\documentclass{article}
\usepackage[capbesideposition=outside,capbesidesep=quad]{floatrow}
\begin{document}
\begin{table}
\floatbox[\capbeside]{table}
{\caption{A test table with its caption beside}\label{tab:test}}%
{\begin{tabular}{ll}
column 1a & column 2a \\
column 1b & column 2b \\
column 1c & column 2c
\end{tabular}}
\end{table}
\end{document}
另一个选择是sidecap
包裹:
\documentclass{article}
\usepackage{sidecap}
\begin{document}
\begin{SCtable}
\begin{tabular}{ll}
column 1a & column 2a \\
column 1b & column 2b \\
column 1c & column 2c
\end{tabular}
\caption{A test table with its caption beside}\label{tab:test}
\end{SCtable}
\end{document}