I have a fairly long table which should go over 2 pages. I used the package longtable
to be able to add \pagebreak
s. Now, I used another tabular environment in one of the columns since I have a pretty long text and I want it to go over two lines.
I compiled the table already, without longtable. It works perfectly. But I now I get a lot of error messages, most of them something like "misplaced alignment tab character ...".
Is there another package I could that would allow me to have a table within the other (since I guess that that is the problem) or is there another way to get the text within a column to go over two lines?
I am new to LaTeX and just couldn't figure it out. I also hope my MWE works, I have no idea how to get it into code.
\documentclass[12pt,a4paper]{scrreprt}
\usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2cm,includeheadfoot]{geometry}
\setlength{\headheight}{15pt}
\usepackage[labelfont=bf,textfont={small}]{caption}
\usepackage{subcaption}
\usepackage{tabularx}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{lontable}{ccccc}
\toprule
\textbf{Cell Line} & & \textbf{Sub Clones} & \textbf{Name} & \textbf{Time Point} \\
\midrule
\endhead
\multirow{38}[0]{*}{\textbf{CHO-K1 CTG\_S4 T}} & \multirow{23}[0]{*}{PXP} & \multirow{5}[0]{*}{\begin{tabular}{@{}c@{}}CHO-K1 CTG\_S4 \\ PXP\_S1 2B3 SVC \end{tabular}}& \multirow{5}[0]{*}{SVC3} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{3-5}
& & \multirow{5}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\ PXP\_S2 2.3 SVC\end{tabularx}} & \multirow{5}[0]{*}{SVC5} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{3-5}
& & \multirow{4}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\ PXP\_S1 2B3 AAA\end{tabularx}} & \multirow{4}[0]{*}{AAA3} & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{3-5}
& & \multirow{5}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\PXP\_S1 2.1 AAA\end{tabularx}} & \multirow{5}[0]{*}{AAA4} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{3-5}
& & \multirow{4}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\PXP\_S1 2.3 AAA\end{tabularx}} & \multirow{4}[0]{*}{AAA5} & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{2-5}
\pagebreak
& \multirow{5}[0]{*}{PX} & \multirow{5}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\PX\_S1 3A1\end{tabularx}} & \multirow{5}[0]{*}{VD2} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{2-5}
& \multirow{10}[0]{*}{TT} & \multirow{5}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\TT\_S1 1A4\end{tabularx}} & \multirow{5}[0]{*}{VD3} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\cmidrule{3-5}
& & \multirow{5}[0]{*}{\begin{tabularx}{@{}c@{}}CHO-K1 CTG\_S4 \\TT\_S1 3A4\end{tabularx}} & \multirow{5}[0]{*}{VD4} & T\textsubscript{0} \\
& & & & T\textsubscript{1} \\
& & & & T\textsubscript{2} \\
& & & & T\textsubscript{3} \\
& & & & T\textsubscript{4} \\
\bottomrule
\caption{Sample Table CHO-K1 CTG\_S4 T}
\label{tab:table3}%
\end{lontable}%
\end{document}
longtable
! yourtabularx
syntax is incorrect, usetabular
nottabularx
(tabularx
requires an extra argument and anX
column, but you wanttabular
here nottabularx
)