How can I display the table caption at the left side?
[Tex/LaTex] Caption at left side of the table
captionstables
Related Solutions
Like this one?
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}
\captionsetup[figure]{slc=off} % "slc" is an abbreviation for "singlelinecheck"
\begin{document}
\begin{figure}
\centering
\captionbox
{Blah... \label{fig:test}}
{\includegraphics{test}}
\end{figure}
\end{document}
P.S.: The same effect can be archived using \ffigbox
offered by the floatrow
package, for example:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow,caption}
\captionsetup[figure]{slc=off}
\begin{document}
\begin{figure}
\centering
\ffigbox[\FBwidth]
{\caption{Blah...}\label{test}}
{\includegraphics{test}}
\end{figure}
\end{document}
(For making \captionsetup[figure]{slc=off}
work the caption
package is needed here additionally.)
Citing from the threeparttable package:
This package facilitates tables with titles (captions) and notes. The title and notes are given a width equal to the body of the table (a
tabular
environment). By itself, athreeparttable
does not float, but you can put it in atable
or atable*
or some other floating environment. (This causes extra typing, but gives more flexibility.)
So, threeparttable
package directly addresses your problem. There are other options like \parbox
or setting \captionsetup{width=..}
, but are less flexible.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs,caption,threeparttable}
\usepackage{siunitx}
\captionsetup{labelfont=bf,
justification=raggedright,
singlelinecheck=false}
\begin{document}
\begin{table}[!htbp]
\centering
\begin{threeparttable} % <===
\caption{Percentage of Missing Values in the Analysis Variables}
\begin{tabular}{>{\bfseries}lS}
Variable & {Percent missing} \\ \toprule
x & 9.37 \\
Lxon & 0.94 \\
x & 0 \\
x & 0.04 \\
x & 0.34 \\
Exl & 7.93 \\
Rxe & 15.32 \\
Sxm & 8.69 \\
Txal & 4.43 \\
x & 1.33 \\
Nxnces & 0.9 \\
xs & 1.12 \\
Fxans & 0 \\
xxation & 2.4 \\
Cxon & 0.58 \\
xg & 0 \\
x x & 0.22 \\
x to x from x o. x & 1.03 \\
x to x & 0.76 \\
x & 0.99 \\
x & 0.09 \\
x & 0.83 \\ \bottomrule
\end{tabular}%
\end{threeparttable} % <===
\label{tab:addlabel}%
\end{table}%
\end{document}
Best Answer
with use of package
sidecup
: