1

enter image description here

I need to write a long paragraph in my table, but the text goes out of the margins.. Here is my code:

\begin{tabular}{l l}

       \textbf{P1.1} & aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\

       \textbf{P4.1} &  bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\

\end{tabular}

How can I correct this?

1

Use scalable p{<width>} column. aaa... and bbb... are bad examples for long text, as TeX can't hyphenate them, due to not being actual words.

\documentclass{standalone}
\usepackage{blindtext}% \blindtext creates a paragraph of dummy text
\begin{document}
\begin{tabular}{lp{0.6\textwidth}}
       \textbf{P1.1} & \blindtext \cr
       \textbf{P4.1} & \blindtext \cr
\end{tabular}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.