0

I have a table that has multiple-row columns, and I could use booktabs and multirow package for it.

\documentclass[12pt, twocolumn]{article}

\usepackage{booktabs}
\usepackage{multirow}

\newcommand{\blah}{blah blah blah blah blah blah blah blah blah blah blah blah blah blah}
\newcommand{\blahx}{blah blah blah blah blah blah blah}

\begin{document}

\begin{table}[ht]
\caption{Stories}\label{tab:scenarios}
\centering
\def\arraystretch{1.2}%  1 is the default, change whatever you need
\begin{tabular}{c|p{4.4cm}|p{2.2cm}}\toprule
{\bf Story} & {\bf Description} & {\bf Properties} \\
\midrule\hline

% item 1/2 
\multirow{2}{*}{s1} & \blah
    & \multirow{4}{2.4cm}{\blahx}\\
\cline{1-2}
\multirow{2}{*}{s2} & \blah
 & \\

\hline

% item 3/4 
\multirow{2}{*}{s3} & \blah
  & \multirow{4}{2.4cm}{\blahx} \\
\cline{1-2}
\multirow{2}{*}{s4} & \blah
 & \\

\hline

% item 5/6 
\multirow{2}{*}{s5} & \blah
 & \multirow{4}{2.4cm}{\blahx}\\
\cline{1-2}
\multirow{2}{*}{s6} & \blah
 & \\

% Closing table
\hline\bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

The table looks OK when the table contents strings are small. However, the first column (probably the second column), and final column that use the multi-row is not vertically centered. How to make it vertically centered?

1

Replace the p column qualifier with m. The first column doesn't require any multirow. Finally I suggest removing all vertical rules, and much less horizontal rules, replaced with \addlinespaces:

\documentclass[12pt, twocolumn]{article}

\usepackage{booktabs}
\usepackage{array, multirow, caption}

\begin{document}

\begin{table}[ht]
  \caption{Stories}\label{tab:scenarios}
  \centering
  \def\arraystretch{1.2}% 1 is the default, change whatever you need
  \begin{tabular}{@{}cm{4.4cm}m{2.2cm}@{}}
    \toprule
    {\bfseries Story} & {\bfseries Description} & {\bfseries Properties} \\
    \midrule\midrule
    % item 1/2
    {s1} & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \multirow{4}{2.4cm}{Sample project assignment (err on the side of paying fairly}\\
    \addlinespace
    s2 & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \\
    \midrule
    % item 3/4
    s3 & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \multirow{4}{2.4cm}{Sample project assignment (err on the side of paying fairly} \\
    \addlinespace
    s4 & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \\
    \midrule
    % item 5/6
    s5 & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \multirow{4}{2.4cm}{Sample project assignment (err on the side of paying fairly}\\
    %\cmidrule{1-2}
    \addlinespace
    s6 & PAID Sample project assignment (err on the side of paying fairly for estimated completion time
    & \\
    % Closing table
    \midrule\bottomrule
  \end{tabular}
\end{table}

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.