I am creating a report in LaTeX which involves a few tables. I'm stuck on that as my cell data in the table is exceeding the width of the page. Can I somehow wrap the text so that it falls into the next line in the same cell of the table?
Is it somehow related to the table's width? But as it's overshooting the page's width, will it make a difference?
To change the text AB into A \r B in a table cell, put this into the cell position: \makecell{A \\ B} . Before doing that, you also need to include package makecell . Show activity on this post. The new tabularray makes wrapping text in cells easier then ever before.
Select the table and either right-click and choose “Table Properties” or pick “Properties” in the floating toolbar. Go to the Table tab in the pop-up window. In the Text Wrapping section at the bottom, select Around and click “OK.”
Use p{width} for your column specifiers instead of l/r/c.
\begin{tabular}{|p{1cm}|p{3cm}|} This text will be wrapped & Some more text \\ \end{tabular}
EDIT: (based on the comments)
\begin{table}[ht] \centering \begin{tabular}{p{0.35\linewidth} | p{0.6\linewidth}} Column 1 & Column2 \\ \hline This text will be wrapped & Some more text \\ Some text here & This text maybe wrapped here if its tooooo long \\ \end{tabular} \caption{Caption} \label{tab:my_label} \end{table}
we get:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With