为什么第一列的文字没有按照其宽度换行?

为什么第一列的文字没有按照其宽度换行?

我有以下代码

\documentclass[a4paper, 11pt]{article}
\usepackage{multirow}
\begin{document}

\begin{tabular}{|p{2cm}|p{6cm}|p{1cm}|p{1cm}|p{1cm}|}
\hline
\multicolumn{2}{|c|}{} & Start date & End date & Days spent\\
\hline
\multirow{6}{2cm}{Background research} & This is some long text that wraps below& Lucus Radebe  & & \\
 & This is some long text that wraps below & Michael Duberry  & & \\
 & This is some long text that wraps below & Dominic Matteo  & & \\
  & This is some long text that wraps below & Dominic Matteo  & & \\
   & This is some long text that wraps below & Dominic Matteo  & & \\
 & This is some long text that wraps below & Didier Domi  & & \\ \hline
\multirow{3}{2cm}{Midfielders} & MC & David Batty  & & \\
 & MC & Eirik Bakke  & & \\
 & MC & Jody Morris  & & \\ \hline
Forward & FW & Jamie McMaster  & & \\ \hline
\multirow{2}{2cm}{Strikers} & ST & Alan Smith  & & \\
 & ST & Mark Viduka  & & \\
\hline
\end{tabular}
\end{document}

第三列的文本会换行,但第一列不会。我怎样才能让第一列的文本也换行呢?

编辑:一个可能的解决方案

使用\multirow{6}{2cm}{{\begin{center}Defenderss adsadasdasdas\end{center}}}

但如果其他行被换行,则无法保持垂直对齐

答案1

我认为你想使用2cm而不是*作为宽度参数\multirow

在此处输入图片描述

\documentclass{article}

\usepackage{multirow}

\begin{document}

\begin{tabular}{|p{2cm}|l|p{2cm}|}
\hline
\multicolumn{3}{|c|}{Team sheet} \\
\hline
Goalkeeper & GK & Paul Robinson \\
\hline
\multirow{6}{2cm}{Defend\-erss adsad\-asda\-sdas} & LB & Lucus Radebe \\
 & DC & Michael Duberry \\
 & DC & Dominic Matteo \\
 & DC & Dominic Matteo \\
 & DC & Dominic Matteo \\
 & RB & Didier Domi \\
 \hline
\multirow{3}{2cm}{Midfielders} & MC & David Batty \\
 & MC & Eirik Bakke \\
 & MC & Jody Morris \\
 \hline
Forward & FW & Jamie McMaster \\
\hline
\multirow{2}{2cm}{Strikers} & ST & Alan Smith \\
 & ST & Mark Viduka \\
\hline
\end{tabular}

\end{document}

相关内容