0

I have this table and I want everything center but when I use multicolumn the words are nor center and the two last columns have different width. The image below shows the result.

enter image description here

The code I'm using is:

\documentclass[10pt,a4paper]{report}

\usepackage{booktabs}
\usepackage{multirow}

\begin{document}

\begin{table}[!h]
    \renewcommand{\arraystretch}{1.2} % more space between rows
    \centering
    \caption{Particle average size obtained via TEM analysis.}
    \begin{tabular}{c|c|c|c}
        \toprule
        \multirow{2}{*}{Sample}& \multirow{2}{*}{Morphology} & \multicolumn{2}{c}{Particle average size (nm)} \\ \cline{3-4}
        & & Diameter & Length \\ 
        \midrule
        Pr-100-300-60 &  & & \\
        W-100-400-30  &  & & \\
        W-75-400-30  &  & & \\
        W-50-400-30  &  & & \\
        W-25-400-30  &  & & \\
        W-0-400-30   &  & & \\ \bottomrule
    \end{tabular}
    \label{tab:TEM}
\end{table}

\end{document}

So, I can I put the width of the columns equal and center the words 'Particle average size (nm)'? Thanks for the help

1 Answer 1

1

Use tabularx package. Avoid using vertical lines.

    \documentclass[10pt,a4paper]{report}
    \usepackage{booktabs}
    \usepackage{multirow, tabularx,array}

    \begin{document}

    \begin{table}[!h]
    %\renewcommand{\arraystretch}{1.2} % more space between rows
    \centering
    \caption{Particle average size obtained via TEM analysis.}
\begin{tabularx}{0.75\textwidth}{cc *2{>{\centering\arraybackslash}X}}
    \toprule
    \multirow{2}{*}{Sample}& \multirow{2}{*}{Morphology} &    \multicolumn{2}{c}{Particle average size (nm)} \\ \cmidrule(lr){3-4}
    & & Diameter & Length \\ 
    \midrule
    Pr-100-300-60 &  & & \\
    W-100-400-30  &  & & \\
    W-75-400-30  &  & & \\
    W-50-400-30  &  & & \\
    W-25-400-30  &  & & \\
    W-0-400-30   &  & & \\ \bottomrule
\end{tabularx}
\label{tab:TEM}
\end{table}

\end{document}
0

You must log in to answer this question.

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