0

I have a table over two pages. Every question of my table is separated with \miderule. However one question is quite long. I want this to span over two pages but because I structured it with midrule it shows up on the next page. Is there any way to fix this.

\begin{longtable}[l]{p{.21\textwidth} p{.74\textwidth}}
\toprule
\textbf{Topic}                                                                                                          & \textbf{Question}
                                                                                                                     \\ 

\midrule
Introduction
\\ 
\midrule
Background information & 
Q1. This is a question
\\ 

\midrule
Design & 
Q1. This is a question
\newline  Q2. This is a question
\\
\midrule
Prototype & 
Q3. This is a question
\newline a. Type
\newline b. Type
\newline c. Type
\newline d. Type
\newline e. Type
\newline f. Type**

If for instance I want to put c,d,e,f on a new page it doesn't work. Q3 is simply but on a new page fully and doesn't span over two pages.

  • Welcome to TeX.SX! You can't split a cell inside an alignment across two pages. – egreg Jun 26 '14 at 13:41
  • Thank you, but how? Now Question 4 just begins on a new page. – Dan Jun 26 '14 at 13:42
  • That's what I said: you can't split a cell across two pages. Do \\ where it's necessary and continue in another row. – egreg Jun 26 '14 at 13:42
  • @Dan Please make your example compilable. We can help you better then. A hint: just do a new cell without a midrule and write your content-for-the-second-page in there. – LaRiFaRi Jun 26 '14 at 13:47
  • Almost certainly this would be better set as a list rather than a longtable, then page breaking would occur naturally within entries – David Carlisle Jun 26 '14 at 14:55
1

A cell can not be distributed over two pages. Therefore, you will have to split this manually by putting the next-page-content into a new cell. Without a new \midrule, this will not differ from what you have desired.

The \newpage in my MWE can be removed. It's just for demonstration purpose.

% arara: pdflatex

\documentclass{article}
\usepackage{longtable,booktabs}

\begin{document}
\null % can be removed
\vfill % can be removed
\begin{longtable}[l]{p{.21\textwidth} p{.74\textwidth}}
\toprule
\textbf{Topic} & \textbf{Question}\\ 
\midrule
Introduction & \\ 
\midrule
Background information & Q1. This is a question\\ 
\midrule
Design & Q1. This is a question\newline  
Q2. This is a question\\
\midrule
Prototype & Q3. This is a question
\newline a. Type
\newline b. Type
\newline c. Type
\newline d. Type
\newline e. Type
\newline f. Type**\\
\newpage % can be removed
& g. Type\newline
h. Type\\
\bottomrule
\end{longtable}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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