带图像的 Latex 表格

带图像的 Latex 表格

在此处输入图片描述

我想知道如何用代码实现这个

  \begin{table}[h]
  \begin{tabular}{|lll|}
  \hline
  \multicolumn{4}{|c}{} \includegraphics[scale=0.80]{UAGpractica.jpg}  & \multicolumn{4}{c}{} &  \\
                        &                      &  \\
                        &                      &  \\ \hline
  \end{tabular}
  \end{table}

答案1

我建议如下。第二个表格使用tabularx以使表格与文本宽度一样宽:

填写正确的文本由您决定,如果您希望显示图像而不是黑色方块,请demo从中删除该选项graphhicx

在此处输入图片描述

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tabularx}
\usepackage{ragged2e}


\begin{document}

\noindent
\begin{tabular}{|@{}l@{}l@{}|}
\hline
\includegraphics[scale=0.80,valign=c]{UAGpractica.jpg}  & \begin{tabular}[c]{c}
                                                          \textbf{some text}\\
                                                          \hline
                                                          \textbf{some more text}\\
                                                          \textbf{a second line of text}\\
                                                          \hline
                                                          \textbf{third row}\\
                                                          \hline
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          \end{tabular}\\
\hline
\end{tabular}

\bigskip

\noindent
\begin{tabularx}{\textwidth}{|@{}l@{}c@{}|}
\hline
\includegraphics[scale=0.80,valign=c]{UAGpractica.jpg}  & \begin{tabular}[c]{>{\Centering}X}
                                                          \textbf{some text}\\
                                                          \hline
                                                          \textbf{some more text}\\
                                                          \textbf{a second line of text}\\
                                                          \hline
                                                          \textbf{third row}\\
                                                          \hline
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          four rows of non bold text\\
                                                          \end{tabular}\\
\hline
\end{tabularx}

\end{document}

相关内容