Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a problem with too long text in one cell.

Text in cell is autocreated, and I cannot know previously how long will be it. When text is too long LaTeX pushes the cell off the bottom of the page.

Is the some way to teach LaTeX automatically to transfer text on the next page (not out of page)? Maybe you can offer some package that can fix my problem.

For table creating I use longtable.

enter image description here

Some example:

\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{|p{0.2\textwidth}|p{0.7\textwidth}|}
Text & Steps \\ \hline
  & 1.step \newline
    2.step \newline
    3.step \newline
    4.step \newline
    5.step \newline
    6.step \newline
    7.step \newline
    ................. \newline
    57.step \newline
    58.step \newline
    59.step \newline
    60.step \newline
    61.step \newline
    62.step \newline
    63.step \newline
    64.step \newline
    65.step \newline
    66.step \newline
    67.step \\ \hline
\end{longtable}
\end{document}

One more example:

\begin{longtable}{|p{3.2cm}|p{1.5cm}|p{1.5cm}|p{1.3cm}|} \hline
\textit{\textbf{\normalsize{Description:}}}     & \multicolumn{3}{p{7.5cm}|} {Some description of Table} \\ \hline
\textit{\textbf{\normalsize{Steps:}}} & \multicolumn{3}{p{7.5cm}|} {
1. step  \newline
2. step  \newline
3. step  \newline
4. step  \newline
5. step  \newline
6. step  \newline
7. step  \newline
......   \newline
63. step \newline
64. step \newline
65. step \newline
66. step \newline
67. step 
} \\  \hline
\textit{\textbf{\normalsize{Remarks:}}}         & \multicolumn{3}{p{7.5cm}|} {---} \\                     \hline
\textit{\textbf{\normalsize{Date:}}}     & \multicolumn{3}{p{7.5cm}|} {2012/10/23} \\                     \hline
\parbox[c]{\textwidth}{\textit{\textbf{\normalsize{Approval}}}}   & \normalsize{\parbox[c]{\textwidth}{+}} & \normalsize{\parbox[c]{\textwidth}{+}} & \normalsize{\parbox[c]{\textwidth}{\textbf{-}}} \\   \hline
\end{longtable}

one more example

share|improve this question
1  
Can you provide a minimal working example (MWE)? –  hpesoj626 Oct 17 '12 at 6:00
1  
Did you re-run this? Sometime longtable requires several runs. As @hpesoj626 suggested it would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that illustrates the problem. Otherwise it is difficult to know what went wrong. –  Peter Grill Oct 17 '12 at 6:13
    
A tip: You can use backticks ` to mark your inline code as I did in my edit. To mark a large block of inline code, select it and press Ctrl+K. –  Andrew Uzzell Oct 23 '12 at 15:09

1 Answer 1

Cells of tables are not breakable across pages. Perhaps you can teach the autocreation process to make single cells instead:

\documentclass{article}
\usepackage{longtable}
\begin{document}
\begin{longtable}{|p{0.2\textwidth}|p{0.7\textwidth}|}
Text & Steps \\ \hline
  & 1.step \tabularnewline
  & 2.step \tabularnewline
  & 3.step \tabularnewline
  & 4.step \tabularnewline
  & 5.step \tabularnewline
  & 6.step \tabularnewline
  & 7.step \tabularnewline
  & ................. \tabularnewline
  & 57.step \tabularnewline
  & 58.step \tabularnewline
  & 59.step \tabularnewline
  & 60.step \tabularnewline
  & 61.step \tabularnewline
  & 62.step \tabularnewline
  & 63.step \tabularnewline
  & 64.step \tabularnewline
  & 65.step \tabularnewline
  & 66.step \tabularnewline
  & 67.step \\ \hline
\end{longtable}
\end{document}

Result

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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