Graphics, Figures & TablesWrapping text in columns

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Pratt_G
Posts: 3
Joined: Mon Sep 02, 2013 5:41 pm

Wrapping text in columns

Post by Pratt_G »

Hi,

I am trying to make a table such that contents of one of the columns should be wrapped between two rows. I hope the MWE below explains what I am trying to do. Can anyone please suggest me how to get this working?

Code: Select all

\documentclass[11 pt]{article}

\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{booktabs}

\begin{document}

\begin{table}[!ht]
\caption{Example}
\centering
\def\arraystretch{1.7}
\begin{tabular}{l l c c c p{2 cm}}
\toprule
A1   		&B1		&C1		&D1	 &E1		&F1\\
A2		&B2		&C2		&D2	 &E2		&F2\\
\hline									
A3		&B3		&C3		&D3	 &E3		&\multirow{2}{*}{I want this text to wrap between third and fourth row}\\ 
A4		&B4		&C4		&D4	 &E4		\\
\bottomrule
\end{tabular}
\end{table}
\end{document}
Thanks,
Pratt

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Wrapping text in columns

Post by Johannes_B »

Hi,

I am not sure, but i think you just want to give your multirow-command a specified width. I took the width of the par-column.

Code: Select all

\multirow{2}{2cm}{I want this text to wrap between third and fourth row}
If you put a star in the second mandatory command, width of the column take up "the natural width of the text argument".


Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply