[Tex/LaTex] Simultaneously align and size table cells

tableswrap

When I use multicolumn and multirow together in a table, text does not wrap within the multicolumn, and the column size is automatically taken to be very long. Code with problem is attached:

\begin{table}[htbp]
\centering
%  \resizebox{\textwidth}{!}{%
  \begin{tabular}{| C{2cm} | C{2cm} | C{2cm} |}  \hline
  \multirow{2}{4em} {Crack length(a)} & \multicolumn{2}{c}{Geometric (and loading) parameter in SIF}\\\cline{2-3}
  & Present & From ~\cite{RC2}\\\hline
0.200 & 1.297 & 1.313 \\\hline
0.300 & 1.426 & 1.431 \\\hline
0.400 & 1.565 & 1.567 \\\hline
 \end{tabular}

How do I make the column size fixed and wrap the text within it? If the multicolumn text needs 2 rows, that is also fine. But how to nest multirows and multicolumn?

Best Answer

Does something like the following meet your objectives?

enter image description here

\documentclass{article}
\usepackage{array} % no need for 'multirow' package, really
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % is this right?
\begin{document}

\begin{table}[htbp]
\setlength\extrarowheight{2pt} % for a more "open" look
\centering
 \begin{tabular}{| C{2cm} | C{2cm} | C{2cm} |}  
 \hline
 Crack length (a) & 
 \multicolumn{2}{C{\dimexpr4cm+2\tabcolsep\relax}|}{Geometric (and loading) parameter in SIF}\\
 \cline{2-3}
       & Present & From \cite{RC2}\\\hline
 0.200 & 1.297   & 1.313 \\\hline
 0.300 & 1.426   & 1.431 \\\hline
 0.400 & 1.565   & 1.567 \\\hline
\end{tabular}
\end{table}
\end{document}