I would like to center text and images both vertically and horizontally in a longtable. However I can't seem to get it to work unfortunately. A example is below:
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{array,longtable,ragged2e}
\usepackage{graphicx}
\begin{document}
\begin{longtable}{| l | c | c |}
\hline
& Here is a Text & Here is a Text \\hline
Here is a Text & \includegraphics[height=2cm]{img/image.png} & \includegraphics[height=2cm]{img/image.png} \\hline
Here is a Text & \raisebox{-\height}{\includegraphics[height=2cm]{img/image.png}} & \raisebox{-\height}{\includegraphics[height=2cm]{img/image.png}} \\hline
\caption{My Caption}
\label{tab:FirstTab}
\end{longtable}
\mbox{}\
\end{document}
I also tried the changes below, but it didn't help:
Here is a Text & \raisebox{-\height}{\includegraphics[height=2cm]{img/image.png}} & \raisebox{-\height}{\includegraphics[height=2cm]{img/image.png}} \\\hline

\raisebox{\dimexpr 0.5\ht\strutbox-0.5\dp\strutbox-0.5\height}{...}`. The \strutbox stuff locates the center of text, not the baseline. – John Kormylo Nov 07 '20 at 03:17