0

I have a long table and I am using the code

\begin{longtable}[c]{|p{5cm} | c | p{5cm}|}
    \caption{My table.\label{tab:long}}\\
     \hline
        AA & B & C \\
    \hline
    \endfirsthead
    \hline
        \multicolumn{3}{|c|}{Continuation of Table \ref{tab:Long}}\\
     \hline
        AA & B & C \\
    \hline
    \endhead
    \hline
    \endfoot

    \hline
        \multicolumn{3}{| c |}{End of Table}\\
    \hline\hline
    \endlastfoot
    a &\multirow{20}{1em}{b}  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\ \hline

    
    a & \multirow{20}{1em}{x} & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\
    a &  & c \\ 
    \end{longtable}

I want the data of multirow cell to repeat on newpage.

7
  • Why you should repeat cell data on each page? Isn't it better this data to include to captions of table, which can be easy repeated to each page?
    – Zarko
    Jan 9 '21 at 7:32
  • i have more than one mulitirow columns and table is 3 to 4 pages long
    – abrar syed
    Jan 9 '21 at 8:39
  • Which "multicolumn cell" are you referring to?
    – leandriis
    Jan 9 '21 at 9:22
  • 2
    do you mean you want the mulirow to repeat on each page? the only multicolumn I see is in the table head and does repeat. I do not understand the question at all. Jan 9 '21 at 9:53
  • 1
    Combining longtable with \multirow is usually a bit "risky" especially when it comes to multirows spanning a large number of rows since depending on the position of the page breaks, the contents of the multirow might end up overlapping the footer of the page. I thus recommend using a different approach to present the information without the need for a multirow. (For examples of such a redesign see: tex.stackexchange.com/a/568292/134144 and tex.stackexchange.com/a/537076/134144)
    – leandriis
    Jan 9 '21 at 11:52

Your Answer

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

Browse other questions tagged or ask your own question.