禁忌中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}

在此处输入图片描述

相关内容