0

I want to create a complicated long table as in the figure below. I want to create it as a long table so that the heading of the table goes to a new page. The complicity is due to the merge of row and columns.

enter image description here enter image description here

Please help me out.

1 Answer 1

5

You could start here:

\documentclass[12pt]{article}
\usepackage[a6paper, landscape]{geometry} % <-- A6 and landscape just to demonstrate repeating headers

\usepackage{multirow}
\usepackage{longtable}

\begin{document}

\begin{longtable}{|l|l|l|l|l|}
\hline
\multirow{2}{*}{Attribute Group}     & \multicolumn{4}{l|}{Stuff}                                                                \\ \cline{2-5} 
                                     & \multicolumn{2}{l|}{This}                   & \multicolumn{2}{l|}{That}                   \\ \hline
\endhead
%
\multirow{2}{*}{1. Stuff}            & A                  & Lorem                  & C                  & Dolor                  \\ \cline{2-5} 
                                     & B                  & Ipsum                  & D                  & Sit                    \\ \hline
\multirow{2}{*}{2. More Stuff}       & A                  & Tick                   & \multirow{2}{*}{C} & \multirow{2}{*}{Toe}   \\ \cline{2-3}
                                     & B                  & Tack                   &                    &                        \\ \hline
\multirow{2}{*}{3. This never  ends} & A                  & \multicolumn{3}{l|}{Duck duck}                                       \\ \cline{2-5} 
                                     & B                  & \multicolumn{3}{l|}{Duck duck duck}                                  \\ \hline
\multirow{2}{*}{4. Alpha}            & A                  & Lorem                  & C                  & Dolor                  \\ \cline{2-5} 
                                     & B                  & Ipsum                  & D                  & Sit                    \\ \hline
\multirow{4}{*}{5. More ducks}       & A                  & Duck                   & \multirow{4}{*}{E} & \multirow{4}{*}{Duck}  \\ \cline{2-3}
                                     & B                  & Duck                   &                    &                        \\ \cline{2-3}
                                     & C                  & Duck                   &                    &                        \\ \cline{2-3}
                                     & D                  & Duck                   &                    &                        \\ \hline
\multirow{3}{*}{6. Omega}            & A                  & Stuff                  & \multirow{3}{*}{D} & \multirow{3}{*}{Hello} \\ \cline{2-3}
                                     & B                  & Stuff                  &                    &                        \\ \cline{2-3}
                                     & C                  & Stuff                  &                    &                        \\ \hline
\multirow{3}{*}{7. Stuff}            & \multirow{3}{*}{A} & \multirow{3}{*}{Stuff} & B                  & Stuff                  \\ \cline{4-5} 
                                     &                    &                        & C                  & Stuff                  \\ \cline{4-5} 
                                     &                    &                        & D                  & Stuff                  \\ \hline
\end{longtable}

\end{document}

enter image description here

0

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.