将表格标题放在其右侧

将表格标题放在其右侧

我有一个 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}

在此处输入图片描述

相关内容