I've managed to create a table with multirow and multicolumn with fixed widths in the columns. However, I cannot change the width of the column that contains 'Condition'. Ideally I want the text within the column to wrap. Does someone know how I can get the text to wrap and be a set width? Right now I gave it the default '*'. Thank you!
\newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
\multirow{3}{*}{Condition} &
\multicolumn{6}{|c|}{Metrics} \\
\cline{2-7}
& \multicolumn{2}{|C{3cm}|}{Length ($\mu$m)}
& \multicolumn{2}{|C{3cm}|}{Width ($\mu$m)}
& \multicolumn{2}{|C{3cm}|}{Area ($\mu$m\textsuperscript{2})} \\
\cline{2-7}
& \multicolumn{1}{|C{1.5cm}|}{Mean}
& \multicolumn{1}{|C{1.5cm}|}{SD}
& \multicolumn{1}{|C{1.5cm}|}{Mean}
& \multicolumn{1}{|C{1.5cm}|}{SD}
& \multicolumn{1}{|C{1.5cm}|}{Mean}
& \multicolumn{1}{|C{1.5cm}|}{SD} \\
\hline
\end{tabular}
\end{table}
Best Answer
Instead of using fixed column widths and the
m
column type, I would load thetabularx
package and use itstabularx
environment. This approach makes sure that the table will fit inside the width of the text block. In addition, theX
column type (and derived column types, such asC
andL
in the example below) allow automatic line-wrapping.I would also omit all vertical bars (they're not needed! really!) and use the line-drawing macros of the
booktabs
package instead of\hline
and\cline
. Oh, and do look into thesiunitx
package and, in particular, this package's\si
macro that simplifies the consistent writing of scientific units)