4

I have a table, using the tabu environment, in which I would like multirow and multicolumn cells. Inside the cells, any content that doesn't vertically fill the cell should be vertically centred.

However, I can't seem to get it to behave sensibly - everything looks slightly jumbled and uncomfortable and some text spills over the cell boundaries.

I have tried to use X[-1,m] for every column in the column descriptor, without success.

\documentclass{article}

\usepackage{tabu}
\usepackage{multirow}

\begin{document}
    \begin{table}
        \centering
        \caption{Recommendations for treatment }

        \begin{tabu} {X[-1]|X[-1]|X[-1]|X}
            \hline
            T1 & \multicolumn{2}{l|}{N0}  & Radiotherapy or surgery to the primary tumour.\\
            \cline{2-4}
            & N+ & $ <2{cm}$ & Radiotherapy or surgery to the primary tumour and neck.\\
            \cline{3-4}
            &  & $ >2{cm}$ & Radiotherapy or surgery to the primary tumour. Surgery to neck.\\
            \cline{1-4}
            T2 & \multicolumn{2}{l|}{N0}  &  \multirow{3}{*}{\vbox{Radiotherapy or surgery to the primary tumour and neck.}}\\
            \cline{2-3}
            & N+ & $ <2{cm}$ & \\
            \cline{3-4}
            &  & $ >2{cm}$ & Surgery to the primary tumour and neck.\\
            \cline{1-4}
            T3 & \multicolumn{2}{l|}{N0}  & \multirow{3}{*}{\vbox{Radiotherapy or surgery to the primary tumour and neck.}}\\
            \cline{2-3}
            & N+ & $ <2{cm}$ & \\
            \cline{3-4}
            &  & $ >2{cm}$ & Surgery to the primary tumour and neck. Postoperative radiotherapy in selected cases.\\
            \cline{1-4}
            T4 & \multicolumn{2}{l|}{N0} & \multirow{3}{*}{\vbox{Surgery to the primary tumour and neck with planned postoperative radiotherapy to primary site, and to neck if indicated.}}\\
            \cline{2-3}
            & N+ & $ <2 {cm}$ & \\
            & & $>2 {cm}$ &\\
            \hline
        \end{tabu}
    \end{table}

\end{document}

Result is:

Result of the above code

What is the "right" way to achieve this kind of result in tabu enviroments? Or should I be using a different environment?

1

1 Answer 1

3

Here's one possibility; instead of tabu I used the tabularx package; I set the last column to be \RaggedRight from the ragged2e package; to improve the vertical spacing I also redefined \arraystretch. For some of the cells, the second optional argument of \multirow was used to fine tune the position:

\documentclass{article}
\usepackage{ragged2e}
\usepackage{tabularx}
\usepackage{multirow}

\begin{document}

\begin{table}
\centering
\caption{Recommendations for treatment}
\renewcommand\arraystretch{1.4}
\begin{tabularx}{\textwidth} {l|l|l|>{\RaggedRight}X}
            \hline
            \multirow{5}{*}[-1ex]{T1} & \multicolumn{2}{l|}{N0}  & Radiotherapy or surgery to the primary tumour.\\
            \cline{2-4}
            & \multirow{3}{*}[-1ex]{N+} & $ <2{cm}$ & Radiotherapy or surgery to the primary tumour and neck.\\
            \cline{3-4}
            &  & $ >2{cm}$ & Radiotherapy or surgery to the primary tumour. Surgery to neck.\\
            \cline{1-4}
            \multirow{3}{*}[-2ex]{T2} & \multicolumn{2}{l|}{N0}  &  \multirow{2}{*}{\vbox{Radiotherapy or surgery to the primary tumour and neck.}}\\
            \cline{2-3}
            & \multirow{2}{*}{N+} & $ <2{cm}$ & \\
            \cline{3-4}
            &  & $ >2{cm}$ & Surgery to the primary tumour and neck.\\
            \cline{1-4}
            \multirow{4}{*}[-2ex]{T3} & \multicolumn{2}{l|}{N0}  & \multirow{2}{*}{\vbox{Radiotherapy or surgery to the primary tumour and neck.}}\\
            \cline{2-3}
            & \multirow{3}{*}{N+} & $ <2{cm}$ & \\
            \cline{3-4}
            &  & $ >2{cm}$ & Surgery to the primary tumour and neck. Postoperative radiotherapy in selected cases.\\
            \cline{1-4}
            \multirow{3}{*}[-2ex]{T4} & \multicolumn{2}{l|}{N0} & \multirow{3}{*}{\vbox{Surgery to the primary tumour and neck with planned postoperative radiotherapy to primary site, and to neck if indicated.}}\\
            \cline{2-3}
            & \multirow{2}{*}{N+} & $ <2 {cm}$ & \\
            & & $>2 {cm}$ &\\
            \hline
        \end{tabularx}
\end{table}

\end{document}

enter image description here

2
  • Wonderful! Is there any way to vertically centrally align the "T1" and "N+" cells as well? Apr 29, 2013 at 11:39
  • @Inductiveload yes. Please see my updated answer. Apr 29, 2013 at 13:50

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.