Insert text, image and list in a table in LaTeX
In this tutorial, I will show you how to add text, an image, and a list in a row vertically centered in a cell.
In order to insert text, an image, and a list in a row, you can use the column specifier like this,
\begin{tabular}{|c|p{<len>}|p{<len>}|}
\documentclass{article} \usepackage{graphicx} \begin{document} \begin{table} \centering \begin{tabular}{|c|p{5.5cm}|p{3cm}|} \hline Text & \parbox[c]{5cm}{\includegraphics[width=5cm]{example-image-a}} & \begin{itemize} \item Item 1 \item Item 2 \item Item 3 \end{itemize} \\ \hline Text & \parbox[c]{5cm}{\includegraphics[width=5cm]{example-image-b}} & \begin{itemize} \item Item A \item Item B \item Item C \end{itemize} \\ \hline \end{tabular} \caption{Table with Text, Image, and List} \end{table} \end{document}
Output:
But, if you want to vertically center all the images and lists, in this case, you can use the m{<len>}
column specifier provided by the array
package. This special column specifier aligns your images and lists center vertically.
\documentclass{article} \usepackage{graphicx} \usepackage{array} % for m{} column type \begin{document} \begin{table} \centering \begin{tabular}{|c|m{4cm}|m{3cm}|} \hline Text in Cell 1 & \includegraphics[width=3cm]{example-image-a} & \begin{itemize} \item Item 1 \item Item 2 \item Item 3 \end{itemize} \\ \hline Text in Cell 2 & \includegraphics[width=3cm]{example-image-b} & \begin{itemize} \item Item A \item Item B \item Item C \end{itemize} \\ \hline \end{tabular} \caption{Table with Text, Image, and List} \end{table} \end{document}
Output:
Leave a Reply