禁忌中p多行的垂直對齊

禁忌中p多行的垂直對齊

我正在用來tabu創建我的表格。在其中一個表中,我想要一行multirow並將其內容垂直對齊到頂部。

-------------- ---------------------------------
This is p col  First row
               ---------------------------------
               Second row
               ---------------------------------
               Third row
-------------- ---------------------------------
This is p col  First row
               ---------------------------------
               Second row
-------------- ---------------------------------

這是基本的乳膠代碼

\begin{table}
\tabulinesep =_3pt^3pt
\begin{tabu} to \textwidth{p{4cm} X}
\toprule
\multirow{2}{4cm}{This is p col} & First row \\
& Second row \\
\bottomrule
\end{tabu}
\end{table}

我找到了幾種垂直對齊列的解決方案X,但不是垂直對齊p列。

答案1

\documentclass{article}
\usepackage{tabu,multirow,booktabs}
\begin{document}
  \begin{table}
\tabulinesep =_3pt^3pt
\begin{tabu} to \textwidth{p{4cm} X}
\toprule
\multirow{2}[-4]{4cm}{This is p col} & First row \\
& Second row \\
\bottomrule
\end{tabu}
\end{table}
\end{document}

在此輸入影像描述

相關內容