簡體   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