[Tex/LaTex] putting the caption of a table on its right

captionsfloatspositioning

I have a table environment, which has a tabular environment inside, and I would like to put the caption on its right (the table is narrow enough for that), and not below it. How would that be possible?

Best Answer

You can use the floatrow package; a little example:

\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}

enter image description here

Another option is the sidecap package:

\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}

enter image description here