繁体   English   中英

如何垂直居中我的 latex 表格单元格

[英]How to vertically center my latex table cell

我的 Latex 表格看起来像这样

\begin{table}
\centering
\begin{tabular}{clll}
\toprule
 \multirow{2}*{Name} & \multirow{2}*{Description} & \multicolumn{2}{c} 
  {Time}  \\
 \cline{3-4}  
   & & Item1 & Item2  \\
   \midrule
  App1 & Good & 1000ms  & 1000ms  \\

 \bottomrule
 \end{tabular}
  \end{table}

在此处输入图像描述 '

我想知道如何使上表中的Item1Item2垂直居中。 谢谢!

您可以使用命令\cmidrule{3-4} :它等同于\cline{3-4} ,但它改善了表格的外观。

在此处输入图像描述

\documentclass{article}

\usepackage{multirow}
\usepackage{booktabs}
\begin{document}

\begin{table}
\begin{center}
  \begin{tabular}{clll}
    \toprule
    \multirow{2}*{Name} & \multirow{2}*{Description} & \multicolumn{2}{c} {Time}  \\
    \cmidrule{3-4}  
    & & Item1 & Item2  \\
    \midrule
    App1 & Good & 1000ms  & 1000ms  \\
    \bottomrule
  \end{tabular}  
\end{center}
\end{table}

\end{document}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM