# How can I adjust the table caption left/right align with a table?

This is an example picture. I want to make my table like that.

Here what I am doing.

\documentclass{svjour3}
\usepackage{tabularx}
\captionsetup{labelfont=bf, justification=raggedleft, singlelinecheck=false, position=above}

\begin{document}

\begin{table}[ht]
\caption{Definitions of symbols}
\label{Symbols}       % Give a unique label
\begin{tabular}{ll}
\hline\noalign{\smallskip}
{Symbol} & {Definition} \\
\noalign{\smallskip}\hline\noalign{\smallskip}
{$\mathcal{G}$} & Graph \\
{$\mathcal{M}$} & Adjacency matrix \\
{$N$} & Vertices \\
{$E$} & Edges \\
\noalign{\smallskip}\hline
\end{tabular}
\end{table}

\end{document}

• Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Stefan Pinnow Jan 6 at 8:29
• Thanks, @StefanPinnow for your attention to my question. – Umair Chauhan Jan 6 at 9:00

A solution that uses the sidecap package:

\documentclass{article}
\usepackage{tabularx,caption}
\usepackage[leftcaption]{sidecap}
\captionsetup{labelfont=bf, justification=raggedleft, singlelinecheck=false}

\begin{document}
\begin{SCtable}[][ht]
\caption{Definitions of symbols}
\label{Symbols}       % Give a unique label
\begin{tabular}{ll}
\hline\noalign{\smallskip}
{Symbol} & {Definition} \\
\noalign{\smallskip}\hline\noalign{\smallskip}
{$\mathcal{G}$} & Graph \\
{$\mathcal{M}$} & Adjacency matrix \\
{$N$} & Vertices \\
{$E$} & Edges \\
\noalign{\smallskip}\hline
\end{tabular}
\end{SCtable}

\end{document}


• @Umair Chauhen If any solution solves your problem please mark it as acepted by clicking the appropriate mark! – Hafid Boukhoulda Jan 7 at 11:51

with help of floatrow:

\documentclass{svjour3}
\usepackage{booktabs}
\usepackage{floatrow}

\begin{document}
\begin{table}[htb]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidewidth=4cm}}]{table}[\FBwidth]
{\caption{A test figure with its caption side by side}\label{fig:test}}
{\begin{tabular}{ll}
\toprule
Symbol          &   Definition          \\
\midrule
$\mathcal{G}$   &   Graph               \\
$\mathcal{M}$   &   Adjacency matrix    \\
$N$             &   Vertices            \\
$E$             &   Edges               \\
\bottomrule
\end{tabular}}
\end{table}

or

\begin{table}[htb]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=4cm}}]{table}[\FBwidth]
{\caption{A test figure with its caption side by side}\label{fig:test}}
{\begin{tabular}{ll}
\toprule
Symbol          &   Definition          \\
\midrule
$\mathcal{G}$   &   Graph               \\
$\mathcal{M}$   &   Adjacency matrix    \\
$N$             &   Vertices            \\
$E$             &   Edges               \\
\bottomrule
\end{tabular}}
\end{table}

\end{document}