0

Longtable-Finale I'm trying to make a table like the one above

\begin{longtable}{llll}
\caption{Eine Tabelle in Überlänge.} \label{tab:long} \\

\hline \multicolumn{1}{c}{\textbf{First column}} & \multicolumn{1}{c}{\textbf{Second column}} & \multicolumn{1}{c}{\textbf{Third column}} & \multicolumn{1}{c}{\textbf{Third column}}\\ \hline 
\endfirsthead

\multicolumn{4}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{c}{\textbf{First column}} & \multicolumn{1}{c}{\textbf{Second column}} & \multicolumn{1}{c}{\textbf{Third column}} & \multicolumn{1}{c}{\textbf{Third column}}\\ \hline 
\endhead

\hline \multicolumn{4}{r}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot

One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
One & abcdef ghjijklmn & 123.456778 & HALLO \\
\end{longtable}

Result

Now i have massive Problems with the last Part (Umsätze in EUR). Can someone help me please?

1
2

The following input is the same as your own, but it uses the booktabs package and includes the "Umsätze in EUR" part. midrule, toprule and bottomrule are booktabs variants of hline with better spacing. cmidrule is booktabs' cline.

\documentclass{article}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{booktabs} % make sure to add this line to your own document

\begin{document}

\begin{longtable}{llll}
    \caption{Eine Tabelle in Überlänge.} \label{tab:long} \\

    \toprule
    & & \multicolumn{2}{c}{Umsätze in EUR}\\ % this the key addition
    \cmidrule{3-4} % the underline of Umsätze...
    \multicolumn{1}{c}{\textbf{First column}} & \multicolumn{1}{c}{\textbf{Second column}} & \multicolumn{1}{c}{\textbf{Third column}} & \multicolumn{1}{c}{\textbf{Third column}}\\ 
    \midrule
    \endfirsthead

    \multicolumn{4}{c}
    {{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
    \toprule 
    & & \multicolumn{2}{c}{Umsätze in EUR}\\
    \cmidrule{3-4}
    \multicolumn{1}{c}{\textbf{First column}} & \multicolumn{1}{c}{\textbf{Second column}} & \multicolumn{1}{c}{\textbf{Third column}} & \multicolumn{1}{c}{\textbf{Third column}}\\ 
    \midrule
    \endhead

    \midrule
     \multicolumn{4}{r}{{Continued on next page}} \\ 
     \midrule
    \endfoot

    \bottomrule
    \endlastfoot

    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\
    One & abcdef ghjijklmn & 123.456778 & HALLO \\ 
\end{longtable}

\end{document}

The top of the outputted table looks like:

enter image description here

Edit: if you want to add a third column under "Umsätze in EUR", you need to change

\multicolumn{2}{c}{Umsätze in EUR}\\
    \cmidrule{3-4}

to

\multicolumn{3}{c}{Umsätze in EUR}\\
    \cmidrule{3-5}

i.e. 2 --> 3 and 3-4 --> 3-5, in both locations.

edit 2:

This should work:

\documentclass{article}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{booktabs}
\usepackage[left=1in,right=1in]{geometry} % this makes the left and right margins 1 inch/ 2.54cm; change it if you want to keep your preferred margins.

\begin{document}

\normalsize % change this to \small if you can't fit the table in the page width
\begin{longtable}{lllllll}
    \caption{Eine Tabelle in Überlänge.} \label{tab:long} \\

    \toprule
    & & & & \multicolumn{3}{c}{Umsätze in EUR}\\ % this the key addition
    \cmidrule{5-7} % the underline of Umsätze...
    Firma & Ort & PLZ & Straße & 2013 & 2014 & 2015\\ % I got rid of the \multicolumns, as they were affecting alignment
    \midrule
    \endfirsthead

    \multicolumn{7}{c}{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
    \toprule 
    & & & & \multicolumn{3}{c}{Umsätze in EUR}\\
    \cmidrule{5-7}
    \textbf{First column} & \textbf{Second column} & \textbf{Third column} & \textbf{Third column} & 2013 & 2014 & 2015\\ 
    \midrule
    \endhead

    \midrule
    \multicolumn{7}{r}{{Continued on next page}} \\ 
    \midrule
    \endfoot

    \bottomrule
    \endlastfoot

    One & abcdef ghjijklmn & 123.456778 & HALLO & aaaaa & bbbbb & ccccc \\
    One & abcdef ghjijklmn & 123.456778 & HALLO & aaaaa & bbbbb & ccccc \\
    One & abcdef ghjijklmn & 123.456778 & HALLO & aaaaa & bbbbb & ccccc \\
\end{longtable}
\normalsize % return text to normal size


\end{document}
2
  • your question is not very clear
  • page layout of your document is unknown (how wide can table be?)
  • in MWE (Minimal Working Example) you provide a dummy data, which apparently not mimic real data (regarding their lenght), so it is hard to help you in table design
  • regarding problem with multi column cells, @Patrick Ferguson solve your problem in his answer (+1)
  • it is not clear, why you have different column headers in the first part of your table and at other parts
  • for numbers in last three columns is sensible to use S column type defined in the siunitx package: wit it numbers are aligned at decimal coma

One solution for your table, based on retyping showed desired table lookout in the first image in your question), can be:

\documentclass{article}
\usepackage[margin=25mm]{geometry} 
\usepackage{booktabs, longtable, makecell}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\usepackage{siunitx}

\usepackage{lipsum} % for dummy text filler

\begin{document}
    \lipsum[1-4]
\begingroup
\small
\sisetup{table-format=6.2,
         output-decimal-marker={,}
         }
\setlength\tabcolsep{4pt}
\begin{longtable}{@{} llll SSS @{}}
\caption{Eine Tabelle in Überlänge.}
\label{tab:long} \\
    \toprule
    & & & & \multicolumn{3}{c}{\thead{Umsätze in EUR}}  \\ % this the key addition
    \cmidrule{5-7} % the underline of Umsätze...
\thead{Firma} 
    & \thead{Ort} 
        & \thead{PLZ} 
            & \thead{Straße} 
                & {\thead{2013}} 
                    & {\thead{2014}} 
                        & {\thead{2015}}    \\
    \midrule
\endfirsthead
\caption[]{ -- continued from previous page}            \\
    \toprule
    & & & & \multicolumn{3}{c}{\thead{Umsätze in EUR}}  \\ % this the key addition
    \cmidrule{5-7} % the underline of Umsätze...
\thead{Firma}
    & \thead{Ort}
        & \thead{PLZ}
            & \thead{Straße}
                & {\thead{2013}}
                    & {\thead{2014}}
                        & {\thead{2015}}    \\
    \midrule
\endhead
    \midrule
    \multicolumn{7}{r}{\footnotesize\itshape{Continued on next page}}   \\
\endfoot
    \bottomrule
\endlastfoot
%%%% Table body
Donau Buroeinrichtunegen
    & Linz      & 4020  & Schubertplatz 9
        & 51560,00  & 56716,00  & 62387,00  \\
Burocenter Tirol
    & Innsbruck & 6020  & Innstrase 234
        & 480536,00   & 528589,00 & 581448,56 \\ 
Carynthia Firmenauststatittung 
    & Klagenfurt    & 9219 & Kaiser-Frantz.Str. 1806 
        & 199120,00 & 219032,00 & 240935,20 \\
    \addlinespace
Donau Buroeinrichtunegen
    & Linz      & 4020  & Schubertplatz 9
        & 51560,00  & 56716,00  & 62387,00  \\
Burocenter Tirol
    & Innsbruck & 6020  & Innstrase 234
        & 480536,00   & 528589,00 & 581448,56 \\
Carynthia Firmenauststatittung
    & Klagenfurt    & 9219 & Kaiser-Frantz.Str. 1806
        & 199120,00 & 219032,00 & 240935,20 \\
    \addlinespace
Donau Buroeinrichtunegen
    & Linz      & 4020  & Schubertplatz 9
        & 51560,00  & 56716,00  & 62387,00  \\
Burocenter Tirol
    & Innsbruck & 6020  & Innstrase 234
        & 480536,00   & 528589,00 & 581448,56 \\
Carynthia Firmenauststatittung
    & Klagenfurt    & 9219 & Kaiser-Frantz.Str. 1806
        & 199120,00 & 219032,00 & 240935,20 \\
    \addlinespace
Donau Buroeinrichtunegen
    & Linz      & 4020  & Schubertplatz 9
        & 51560,00  & 56716,00  & 62387,00  \\
Burocenter Tirol
    & Innsbruck & 6020  & Innstrase 234
        & 480536,00   & 528589,00 & 581448,56 \\
Carynthia Firmenauststatittung
    & Klagenfurt    & 9219 & Kaiser-Frantz.Str. 1806
        & 199120,00 & 219032,00 & 240935,20 \\
    \addlinespace
Donau Buroeinrichtunegen
    & Linz      & 4020  & Schubertplatz 9
        & 51560,00  & 56716,00  & 62387,00  \\
Burocenter Tirol
    & Innsbruck & 6020  & Innstrase 234
        & 480536,00   & 528589,00 & 581448,56 \\
Carynthia Firmenauststatittung
    & Klagenfurt    & 9219 & Kaiser-Frantz.Str. 1806
        & 199120,00 & 219032,00 & 240935,20 \\
\end{longtable}
\endgroup
\lipsum{6}
\end{document}

enter image description here

If your real table is wider than table above, than is sensible to consider to write some cells contents (for example in the first column and maybe in the fourth too) in two lines. IN this can be of help xltabular package, which is combination of the longtable and tabularx package.

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.