1

I have a table having an image in the first column and text in other three columns. the Image vertically aligns at the top and the text aligns at the bottom although I want the image to be center aligned and text to be top aligned

\usepackage{array}
\newcolumntype{L}{>{\raggedright\arraybackslash}p{3cm}}
\newcolumntype{Q}{>{\raggedright\arraybackslash}p{4cm}}


\begin{table}[h]
 \centering
    \resizebox{\textwidth}{!}{
      \begin{tabular}{ |c|L|Q|L| }
       & \textbf{Column1} & \textbf{Column2} & \textbf{Column3} \\
        \hline
        \includegraphics[width=50mm]{images/1.jpg} &
        column 2 text. &
        column 3 text. &
        column 4 text. \\
        \hline
      \end{tabular}
}
\end{table}
2
\documentclass{article}
\usepackage{array}
\newcolumntype{L}{>{\raggedright\arraybackslash}p{3cm}}
\newcolumntype{Q}{>{\raggedright\arraybackslash}p{4cm}}
\usepackage[export]{adjustbox}

\begin{document}
    \begin{table}[h]
    \centering
\begin{tabular}{ |Q|L|Q|L| }
    \hline
    & \textbf{Column1} & \textbf{Column2}   & \textbf{Column3} \\
    \hline
\includegraphics[width=\linewidth,
                 margin=0pt \tabcolsep pt 0pt \tabcolsep pt, % from "adjustbox"                            
                 valign=c]                                   % from "adjustbox"
                 {example-image}%{images/1.jpg}     
    &   column 2 text. &    column 3 text.  & column 4 text. \\
    \hline
\end{tabular}
    \end{table}

gives:

enter image description here

note: similar question was asked many, many time, it is for sure duplicate ...

edit: after reading your question again i recognize, that you looking for:

enter image description here

for this only change valign=c to valign=t

  • I don't think its a repeat question. I searched a lot. and either they solve image alignment or text alignment. and that too not in simple ways – Imran Khurram Apr 27 '18 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.