I'm trying to centre the content of the cells but I can't do it in merged cells. It's working properly in normal cells, but isn't working in merged cells.
Does anyone knows how to fix it?
Here is my code
\documentclass{article}
\usepackage{tabulary,booktabs}
\begin{document}
\begin{center}
\begin{tabulary}{\linewidth}{C|C|C|C|C|C|C|}
\toprule
\multicolumn{7}{>{\centering\arraybackslash}m{13cm}}{Lorem ipsum dolor sit amet} \\
\midrule
\midrule
\multicolumn{7}{>{\centering\arraybackslash}m{13cm}}{Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes} \\
\midrule
\multicolumn{7}{>{\centering\arraybackslash}m{13cm}}{Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus.} \\
\midrule
Vivamus Integer tincidunt & elementum & semper & nisi & Aenean & vulputate & eleifend \\
\midrule
Donec & vitae & sapien & libero Integer tincidunt & venenatis & faucibus & libero \\
\bottomrule
\end{tabulary}
\end{center}
\end{document}
Best Answer
I am not sure I have fully understood your problem but here is a way to make a table with the first row wrapping in a
multicolumn
. Obviously you will have to adapt the length in them{}
column descriptor to your need.This yields this output:
Note
If you want to automate a little bit the process you can use the
tabularx
environment instead and define a general length for your table in your preamble.It yields this output