我不知道为什么文字会超出范围(如图所示)。提前感谢
\begin{center}
\begin{table}[h!]
\centering
\begin{tabular}{c|c|c|c}
\hline
\centering
No. & Pr & Po & Description \\ \hline
1
&
\begin{minipage}{.3\textwidth}
\centering
\includegraphics[width=4.8cm,height=3cm]{Pictures.png}
\end{minipage}
&
\begin{minipage}{.3\textwidth}
\centering
\includegraphics[width=4.8cm,height=3cm]{Pictures.png}
\end{minipage}
&
\begin{minipage}{.3\textwidth}
\centering
$\bullet$ st\ $\bullet$ st.
\end{minipage}
\\ \hline
\end{tabular}
\end{table}
\end{center}
\FloatBarrier
答案1
- 您的桌子比
\textwidth
:(4 x 0.3\textwidth
= 1.2\textwidth
)更宽 - 除了使用之外,
minipage
您还可以使用p{...}
列类型 - 目前还不清楚,最后一栏的内容是什么,我怀疑它是一些列表
\documentclass{article}
%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage[export]{adjustbox} % it load graphicx too
\usepackage{array}
\usepackage{enumitem}
\begin{document}
\begin{table}[ht]
\centering
\setlist[itemize]{nosep=0pt,
leftmargin=*,
label=\textbullet,
after=\end{minipage}, % <---
before=\begin{minipage}[t]{\linewidth} % <---
}
\adjustboxset{width=.25\textwidth,valign=t, margin=0pt 3pt 0pt 3pt}
\begin{tabular}{|c|*{3}{>{\centering\arraybackslash}p{\dimexpr0.3\linewidth-2\tabcolsep}|}}
\hline
No. & Pr
& Po
& Description \\
\hline
1 & \adjustimage{}{example-image-duck}%{Pictures.png}
& \adjustimage{}{example-image-duck}%{Pictures.png}
& \begin{itemize}
\item st.
\item st
\end{itemize} \\
\hline
\end{tabular}
\end{table}
\end{document}