1

I am writting a paper using latex for the first time, and I have a complex and long table that exceeds the page length. So I want to span the table over multiple pages with the header to be repeated. Also i see some examples that using the longtable package, but my latex template is in two column mode, in addition, I don't have enough experience in latex.

\documentclass[twocolumn]{svjour3}          % twocolumn
%
\smartqed  % flush right qed marks, e.g. at end of proof
%
\usepackage{graphicx}
\usepackage{bigstrut}
\usepackage{multirow}

\begin{document}
%Table 1
% Table generated by Excel2LaTeX from sheet 'Sheet1'
\begin{table}[htbp]
  \centering
  \caption{Add caption}
    \begin{tabular}{|c|c|c|c|c|c|c|c|}
    \hline
    \textbf{head 1} & \multicolumn{3}{c|}{\textbf{head 1}} & \textbf{head 1} & \textbf{head 1} & \textbf{head 1} & \textbf{head 1} \bigstrut\\
    \hline
    \multirow{6}[12]{*}{2} & \multirow{4}[8]{*}{\textbf{Data}} & \multicolumn{2}{c|}{\multirow{2}[4]{*}{\textbf{Data}}} & \multirow{2}[4]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{3-8}          &       & \multicolumn{2}{c|}{\multirow{2}[4]{*}{\textbf{Data}}} & \multirow{2}[4]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{2-8}          & \multicolumn{3}{c|}{\multirow{2}[4]{*}{\textbf{Data}}} & \multirow{2}[4]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
    \hline
    \multirow{12}[24]{*}{4} & \multirow{8}[16]{*}{\textbf{Data}} & \multicolumn{2}{c|}{\multirow{4}[8]{*}{\textbf{Data}}} & \multirow{4}[8]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{3-8}          &       & \multicolumn{2}{c|}{\multirow{4}[8]{*}{\textbf{Data}}} & \multirow{4}[8]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          &       & \multicolumn{2}{c|}{} &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{2-8}          & \multicolumn{3}{c|}{\multirow{4}[8]{*}{\textbf{Data}}} & \multirow{4}[8]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 3 & 1000  & 2000 \bigstrut\\
    \hline
    \multirow{18}[36]{*}{6} & \multicolumn{2}{c|}{\multirow{12}[24]{*}{\textbf{Data}}} & \multirow{6}[12]{*}{\textbf{Data}} & \multirow{6}[12]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 5 & 1000  & 2000 \bigstrut\\
\cline{4-8}          & \multicolumn{2}{c|}{} & \multirow{6}[12]{*}{\textbf{Data}} & \multirow{6}[12]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 5 & 1000  & 2000 \bigstrut\\
\cline{2-8}          & \multicolumn{3}{c|}{\multirow{6}[12]{*}{\textbf{Data}}} & \multirow{6}[12]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 5 & 1000  & 2000 \bigstrut\\
    \hline
    \multirow{24}[48]{*}{8 Data} & \multicolumn{2}{c|}{\multirow{16}[32]{*}{\textbf{Data}}} & \multirow{8}[16]{*}{\textbf{Data}} & \multirow{8}[16]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 5 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 6 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 7 & 1000  & 2000 \bigstrut\\
\cline{4-8}          & \multicolumn{2}{c|}{} & \multirow{8}[16]{*}{\textbf{Data}} & \multirow{8}[16]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 5 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 6 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{2}{c|}{} &       &       & Data 7 & 1000  & 2000 \bigstrut\\
\cline{2-8}          & \multicolumn{3}{c|}{\multirow{8}[16]{*}{\textbf{Data}}} & \multirow{8}[16]{*}{3000} & Data 0 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 1 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 2 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 3 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 4 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 5 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 6 & 1000  & 2000 \bigstrut\\
\cline{6-8}          & \multicolumn{3}{c|}{} &       & Data 7 & 1000  & 2000 \bigstrut\\
    \hline
    \end{tabular}%
  \label{tab:addlabel}%
\end{table}%
\end{document}
% end of file template.tex
0

Can a long table span over multiple pages with header in a two column article? Basically yes, using the supertabular package and environment. However, you use multirow cells, which makes it difficult/impossible to introduce row breaks automatically.

Two suggestions:

  • Split the table into two or more.

  • Use a smaller font size for the table. However, if you don't split the table, you need \tiny, which makes the table fit into one column, but makes it hard to read.

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.