1

I'm using "multirow" in a table but cannot get the columns to centre properly. Can anybody help? My code is below along with a screenshot of the table it's giving me.

Thank you!

Table

\begin{table}[ht]{}
\caption{Results of Conceptual Design}
\centering
\def\arraystretch{1.5}
\begin{tabular}{c@{\qquad}ccc@{\qquad}ccc}
\hline\hline
\multirow{2}{*}{\raisebox{-\heavyrulewidth}{Material}} & \multicolumn{3}{c}
{Thickness Breakdown (\%)} &  \multirow{2}{*}{\raisebox{-\heavyrulewidth}
{Total Thickness (mm)}} & \multirow{2}{*}{\raisebox{-\heavyrulewidth}{Lost 
Profit (\pounds)}}\\
\cmidrule{2-4}
& 0\degree & 45\degree & 90\degree & \\
\hline
a &  1 &  1 & 1 & 1 & 1 \\
b & 1 &  1 & 1 & 1 & 1  \\ [1ex]
\hline
\end{tabular}
\label{table:conresults}
\end{table}

1 Answer 1

2

something like this?

enter image description here

\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs, makecell, multirow}
\renewcommand{\theadfont}{\small}
\renewcommand{\theadgape}{}

\begin{document}
    \begin{table}[ht]
\caption{Results of Conceptual Design}
\label{table:conresults}
    \centering
    \setlength\tabcolsep{12pt}
\begin{tabular}{c ccc cc}
    \toprule
\multirow{3}{*}[3pt]{Material}
    &   \multicolumn{3}{c}{\thead{Thickness\\ Breakdown (\%)}}
        &   \multirow{3}{*}{\thead{Total\\ Thickness\\ (mm)}}
            &   \multirow{3}{*}{\thead{Lost\\ Profit\\ (\pounds)}}\\
    \cmidrule(lr){2-4}
    & \SI{0}{\degree} & \SI{45}{\degree} & \SI{90}{\degree} &     \\
    \midrule
a   & 1 & 1 & 1 & 1 & 1 \\
b   & 1 & 1 & 1 & 1 & 1 \\
    \bottomrule
\end{tabular}
    \end{table}
\end{document}
  • use of multirow hasn't anything with column centering. your problem is to long multicolumn header so the last column under it is wider as is its natural width
  • you should always provide complete small document, as i do in my code above (it is not find to inspect your code in write from scratch what should be in preamble, that is possible to test it)
1
  • That's fantastic, thank you! And sorry, I will do in the future :)
    – tomfishh
    Commented Jan 4, 2018 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .