# How to vertically align a table and a graphic

I have a table and a graphic I'd like to vertically align. My current code is:

\begin{figure}[tbp]
\CenterFloatBoxes
\begin{floatrow}
\hfill
\begin{tabular}{ |l|c| }
\hline
Barbican & 0 \\  \hline
Riverside Walk & 1 \\  \hline
Cheapside & 2 \\  \hline
St Paul's & 3 \\  \hline
Moorgate & 4 \\  \hline
Temple \& Whitefriars & 5 \\  \hline
Bank & 6 \\  \hline
Aldgate \& Tower & 7 \\  \hline
Holborn & 8 \\  \hline
Eastern City Cluster & 9 \\  \hline
Guildhall & 10 \\  \hline
Fenchurch \& Monument & 11 \\  \hline
Fleet Street & 12 \\  \hline
Chancery Lane & 13 \\  \hline
West Smithfield & 14 \\  \hline
Liverpool Street & 15 \\ \hline
London West & 16 \\ \hline
London South & 17 \\ \hline
London North & 18 \\ \hline
London East & 19 \\ \hline
External West & 20 \\ \hline
External North & 21 \\ \hline
External south & 22 \\ \hline
External East & 23 \\ \hline
\end{tabular}
\includegraphics[width=.8\linewidth]{map1}
\end{floatrow}
\end{figure}


However this comes out with:

I've been trying for nearly an hour now to work out how to align them. Any help is greatly appreciated.

• Welcome to TeX.SX! Please post a full MWE. – TeXnician Feb 28 '17 at 12:11
• It depends a bit on what you mean by vertically align. With \begin{tabular}[b]{ |l|c| } you can align at the bottom. – StefanH Feb 28 '17 at 12:26

You forgot to use some specific commands from floatrow: ttabbox and ffigbox. Also \killfloatstyle for captions of different kinds of floats (not necessary here).

\documentclass{article}
\usepackage{graphicx, floatrow}

\begin{document}

\begin{figure}[!htbp]
\CenterFloatBoxes
\begin{floatrow}
\hfill
\ttabbox{%
\begin{tabular}{ |l|c| }
\hline
Barbican & 0 \\ \hline
Riverside Walk & 1 \\ \hline
Cheapside & 2 \\ \hline
St Paul's & 3 \\ \hline
Moorgate & 4 \\ \hline
Temple \& Whitefriars & 5 \\ \hline
Bank & 6 \\ \hline
Aldgate \& Tower & 7 \\ \hline
Holborn & 8 \\ \hline
Eastern City Cluster & 9 \\ \hline
Guildhall & 10 \\ \hline
Fenchurch \& Monument & 11 \\ \hline
Fleet Street & 12 \\ \hline
Chancery Lane & 13 \\ \hline
West Smithfield & 14 \\ \hline
Liverpool Street & 15 \\ \hline
London West & 16 \\ \hline
London South & 17 \\ \hline
London North & 18 \\ \hline
London East & 19 \\ \hline
External West & 20 \\ \hline
External North & 21 \\ \hline
External south & 22 \\ \hline
External East & 23 \\ \hline
\end{tabular}}{}
\killfloatstyle
\ffigbox[\FBwidth]{\includegraphics[width=.8\textwidth]{map1}}{}
\end{floatrow}
\end{figure}

\end{document}


Like this?

To achieve this, many ways exist. I suggest using the adjustbox package for proper alignment of the image:

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}
\begin{figure}[tbp]
\begin{tabular}{ |l|c| }
\hline
Barbican & 0 \\  \hline
Riverside Walk & 1 \\  \hline
Cheapside & 2 \\  \hline
St Paul's & 3 \\  \hline
Moorgate & 4 \\  \hline
Temple \& Whitefriars & 5 \\  \hline
Bank & 6 \\  \hline
Aldgate \& Tower & 7 \\  \hline
Holborn & 8 \\  \hline
Eastern City Cluster & 9 \\  \hline
Guildhall & 10 \\  \hline
Fenchurch \& Monument & 11 \\  \hline
Fleet Street & 12 \\  \hline
Chancery Lane & 13 \\  \hline
West Smithfield & 14 \\  \hline
Liverpool Street & 15 \\ \hline
London West & 16 \\ \hline
London South & 17 \\ \hline
London North & 18 \\ \hline
London East & 19 \\ \hline
External West & 20 \\ \hline
External North & 21 \\ \hline
External south & 22 \\ \hline
External East & 23 \\ \hline
\end{tabular}
\includegraphics[width=.8\linewidth,height=1.1\linewidth,valign=m]{map1}
\end{figure}
\end{document}


Your image and table are too wide to fit in text width (for example determined by package article and also by \usepackage{geometry}). You need to make the picture narrower.

To my taste, it is better to have the table on the right side of the image and without any rules:

\documentclass{article}
\usepackage[showframe,% in real document this option had to be deleted
margin=25mm]{geometry}
\usepackage[demo]{graphicx}
\usepackage{booktabs}

\begin{document}
\begin{figure}[tbp]
\includegraphics[width=.7\linewidth,height=1.1\linewidth,valign=m]{map1}
%
\begin{tabular}{ r l }
0   &   Barbican            \\
1   &   Riverside Walk      \\
2   &   Cheapside           \\
3   &   St Paul's           \\
4   &   Moorgate                \\
5   &   Temple \& Whitefriars   \\
6   &   Bank                    \\
7   &   Aldgate \& Tower        \\
8   &   Holborn                 \\
9   &   Eastern City Cluster    \\
10  &   Guildhall               \\
11  &   Fenchurch \& Monument   \\
12  &   Fleet Street            \\
13  &   Chancery Lane           \\
14  &   West Smithfield         \\
15  &   Liverpool Street        \\
16  &   London West             \\
17  &   London South            \\
18  &   London North            \\
19  &   London East             \\
20  &   External West           \\
21  &   External North          \\
22  &   External south          \\
23  &   External East
\end{tabular}
\end{figure}
\end{document}


Simple [b] option for the tabular and booktabs seems to me a nicer choice.

\documentclass{article}
\usepackage{graphicx,booktabs}
\begin{document}

\begin{figure}[tbp]
\begin{tabular}[b]{@{}rl@{}}
\toprule
0   &  Barbican        \\
1   &  Riverside Walk  \\
2   &  Cheapside       \\
3   &  St Paul's       \\
... &  ..              \\
23  &  External East   \\  \bottomrule