Graphics, Figures & Tablesmultirow | Expand Cells over multiple Rows correspondingly

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gonandriy
Posts: 4
Joined: Wed Dec 14, 2011 7:17 pm

multirow | Expand Cells over multiple Rows correspondingly

Post by gonandriy »

Hello!

I have such table and I can not understand how to expand multirow cells accordingly to text.

Code: Select all

\begin{tabular}{|c|m{5cm}|c|}
\hline
1,1 & 1,2 & 1,3 \bigstrut \\ \hline
2,1 & \multirow{2}{5cm}[0ex]{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur id nisl nunc}
& 2,3
\\ \cline{1-1}\cline{3-3}
3,1 & & 3,3 \\ \hline
4,1 & 4,2 & 4,3 \bigstrut \\ \hline
\end{tabular}
I don't know how long text will be every time, because I get it from another program, so any suggestions with absolute values of parameters probably unusable.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

multirow | Expand Cells over multiple Rows correspondingly

Post by Stefan Kottwitz »

Hi,

did you find a solution in the meantime? Perhaps somebody would have tested your code, if you would have given a small compilable example instead of just the table code snippet.

I think, multirow is so flexible that it is able to adjust the height of the spanned rows, their height is determined by their content. Have a look at Table cell overflow for an answer regarding this issue.

Automatic solutions would be possible using \vphantom and related commands or putting the cell content into a box and using \settoheight to get the height of the box.

Stefan
LaTeX.org admin
Post Reply