答案1
你的问题太笼统了,没法给出具体的答案。我总结了Torbjorn的建议,并附上两个例子:
上图的代码:
\documentclass{article}
\usepackage{tabularx}% for tables
\usepackage{ragged2e}% for smart right adjusting text in table
\usepackage{graphicx}% for figures
\usepackage{caption}% for captions
\usepackage{subfig}% for sub figures
\usepackage[nopar]{kantlipsum}% for dummy text in table
\begin{document}
\noindent%
\begin{tabularx}{\textwidth}{l>{\RaggedRight\arraybackslash}X}
\hline
year & Online Social Networks \\
\hline
1997 & SixDegrees \\
\hline
1998 & \kant[2] \\
\hline
\end{tabularx}
\begin{figure}[h]
\includegraphics[width=\textwidth,% limit table width to text width
height=2cm]{example-image}
\caption{My figure}
\end{figure}
\begin{figure}[h]
\subfloat[my first subfigure]%
{
\includegraphics[width=0.48\textwidth,% limited table width to desired fraction of textwidth
height=2cm]{example-image}
}\hfill
\subfloat[my second subfigure]%
{
\includegraphics[width=0.48\textwidth,% limite table width to desired fraction of textwidth
height=2cm]{example-image}
}
\caption{My figure with two sub figures}
\end{figure}
\end{document}
在给定的 MWE 中,我没有考虑表格标题和行的颜色(您没有提到有关它们的任何问题)。我选择它,tabularx
因为您可以使用它来将表格宽度限制为所需的宽度,例如,\textwidth
并在单元格中启用多行文本。