我在单元格垂直对齐方面遇到了一个问题,这种情况比较复杂。有人知道如何让同一列中的两个单元格具有不同的垂直对齐方式吗?此外,如果您在某些列上使用“p”对齐方式,则会影响表中设置为“m”的其他列的对齐方式。以下是示例:
乳胶中(表 A):
\documentclass{revtex4-1}
\usepackage{array}
\begin{document}
\begin{table*}
\begin{ruledtabular}
\begin{tabular}{ >{\centering}m{0.8 in} >{\centering}m{0.8in}
>{\centering}m{0.8in} >{\centering}m{0.8in}
>{\centering}m{1.5in} >{\centering\arraybackslash}m{1.5in} }
\bfseries Heading 1 & \bfseries Heading 2 & \bfseries Heading 3 & \bfseries Heading 4 & \bfseries Heading Heading Heading 5 & \bfseries Heading Heading Heading 6 \\
\hline
text & text & text & text &
\begin{itemize}
\item texttexttexttexttex texttexttexttexttexttexttexttext \end{itemize} &
\begin{itemize}
\item texttext texttext texttext texttext
\item texttext texttext texttext texttext\end{itemize} \\
\end{tabular}
\end{ruledtabular}
\end{table*}
\end{document}
乳胶中(表B):
\documentclass{revtex4-1}
\usepackage{array}
\begin{document}
\begin{table*}
\begin{ruledtabular}
\begin{tabular}{ >{\centering}m{0.8 in} >{\centering}m{0.8in}
>{\centering}m{0.8in} >{\centering}m{0.8in}
>{\centering}p{1.5in} >{\centering\arraybackslash}p{1.5in} }
\bfseries Heading 1 & \bfseries Heading 2 & \bfseries Heading 3 & \bfseries Heading 4 & \bfseries Heading Heading Heading 5 & \bfseries Heading Heading Heading 6 \\
\hline
text & text & text & text &
\begin{itemize}
\item texttexttexttexttex texttexttexttexttexttexttexttext \end{itemize} &
\begin{itemize}
\item texttext texttext texttext texttext
\item texttext texttext texttext texttext\end{itemize} \\
\end{tabular}
\end{ruledtabular}
\end{table*}
\end{document}
答案1
您可以使用嵌套表格来控制对齐方式并enumitem
使用垂直空间较少的列表:
\documentclass{revtex4-1}
\usepackage{array,enumitem}
\begin{document}
\begin{table*}
\begin{ruledtabular}
\begin{tabular}{ >{\centering}p{0.8 in} >{\centering}p{0.8in}
>{\centering}p{0.8in} >{\centering}p{0.8in}
>{\centering}p{1.5in} >{\centering\arraybackslash}p{1.5in} }
\bfseries Heading 1 & \bfseries Heading 2 & \bfseries Heading 3 & \bfseries Heading 4 & \bfseries Heading Heading Heading 5 & \bfseries Heading Heading Heading 6 \\
\hline
text & text & text & text &
\multicolumn{2}{@{}m{\dimexpr3in+2\tabcolsep}@{}}{%
\begin{tabular}{>{\centering}p{1.5in} >{\centering\arraybackslash}p{1.5in}}
\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
\item texttexttexttexttex texttexttexttexttexttexttexttext \end{itemize} &
\begin{itemize}[leftmargin=1em,noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt]
\item texttext texttext texttext texttext
\item texttext texttext texttext texttext\end{itemize} \\
\end{tabular}}
\end{tabular}
\end{ruledtabular}
\end{table*}
\end{document}