I'm trying to make a table with some multicolumns that have wrapped text, but I also want them to be center justified. I have managed to get the text to wrap using advice from other questions, but it wont center and I don't know why.
\documentclass{article}
\usepackage{array}
\newcolumntype{D}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
\begin{table}[htbp]\centering
\begin{tabular}{l c c c c}
& \multicolumn{2}{D{2cm}}{\textbf{Some Big Words}} & \multicolumn{2}{D{2cm}}{\textbf{More Big Words}} \\
rowname & BlahBlah & BlahBlah & BlahBlah & BlahBlah \\
\end{tabular}
\end{table}
\end{document}
Notice how the multicolumns are not located in the center of the two columns they are supposed to span, but are off to the left. How do I center the multicolumns?
Best Answer
Your titles are centred in the specifed width of 2cm, it's possible to make a vertical stack with a tight box that is centred in a
c
multicolumn by using a nestedtabular