Site icon texblog

Placing graphics/images inside a table

Pictures do not necessarily have to be placed inside the figure environment, but can perfectly be included inside table cells.

The advantage is, you can without any effort arrange a series of images in a matrix and individually scale them. Or, you could combine text with images in a table.

And here is how:

You first need to load the graphicx package to include figures:

\usepackage{graphicx}

Now you can directly start with your table environment and add figures:

\begin{table}[ht]
\caption{A table arranging  images}
\centering
\begin{tabular}{cc}
\includegraphics[scale=1]{graphic1}&\includegraphics[scale=1]{graphic2}\\

\includegraphics[scale=1]{graphic3}&\includegraphics[scale=1]{graphic4}\\
\end{tabular}
\label{tab:gt}
\end{table}

Note: In order to get a visual separation between cells, use \hline instead of \newline or a blank line as in the example. For horizontal separation, use |c|c| instead of cc.

The downside of this technique is obvious, you do not have access to features provided by the figure environment like a label or caption. Nevertheless, it might still come in handy in certain situations.

Note: The figures will not appear in the \listoffigures index, for the reason mentioned above.

 
Complete minimal working example

\documentclass[11pt]{article}
\usepackage{graphicx, array, blindtext}
\begin{document}
\begin{table}[ht]
\caption{A table arranging  images}
\centering
\begin{tabular}{*{2}{m{0.48\textwidth}}}
\hline
This is some text&\begin{center}\rule{0.4\textwidth}{0.3\textwidth}\end{center}\\
\hline
\blindtext&\begin{center}\rule{0.4\textwidth}{0.3\textwidth}\end{center}\\
\hline
\end{tabular}
\label{tab:gt}
\end{table}
\end{document}

Exit mobile version