The cells and headers in my table are wrongly aligned: the headers are not set left and the last column reaches over the horizontal lines.

enter image description here


        begin table=\begin{longtable},
        end table=\end{longtable},
        col sep=semicolon,
        read comma as period=true,
        every column/.style={column type=l, fixed, fixed zerofill},
        every first column/.style={column type/.add={@{}}{}},
        every last column/.style={column type/.add={}{@{}}},
        empty header/.style={every head row/.style={output empty row}}
        Quadrant;Bereich;Nummer;Ra 1;Ra 2;Ra 3;Ra_m;Ra_s;Rz 1;Rz 2;Rz 3;Rz_m;Rz_s;Rz_m_B;Rz_s_B;Rz_m_Q;Rz_s_Q;E-Modul;Bruchdehnung;Zugfestigkeit;Streckdehnung


        columns={Quadrant, Bereich, Nummer, Rz 1, Rz 2, Rz 3, Rz_m, Rz_s},
        columns/Quadrant/.style={string type, column type=l},
        columns/Bereich/.style={string type, column type=l},
        columns/Nummer/.style={string type, column type=l},
        columns/Rz 1/.style={precision=1},
        columns/Rz 2/.style={precision=1},
        columns/Rz 3/.style={precision=1},
        empty header,
        every first row/.append style={%
            before row={%
                \caption{Messergebnisse der Oberflächenuntersuchung der Zugstäbe}\label{tab:rauheit_mess} \\
                \multicolumn{3}{@{}c}{Zugstab} & \multicolumn{5}{c@{}}{Oberflächenrauheit $R_{z}$ in \si{\um}} \\
                \cmidrule(r){1-3} \cmidrule(l){4-8}
                Quadrant & Bereich & Nummer & \#1 & \#2 & \#3 & $\overline{x}$ & $\sigma$ \\
                \multicolumn{8}{@{}l}{{\textsc{tabelle}\ \thetable{} -- Fortsetzung}} \\
                \multicolumn{3}{@{}c}{Zugstab} & \multicolumn{5}{c@{}}{Oberflächenrauheit $R_{z}$ in \si{\um}} \\
                \cmidrule(r){1-3} \cmidrule(l){4-8}
                Quadrant & Bereich & Nummer & \#1 & \#2 & \#3 & $\overline{x}$ & $\sigma$ \\
                \multicolumn{8}{r@{}}{Fortsetzung auf nächster Seite}


EDIT: The problem with the overreaching last column is apparently due to longtable and its columnwidths. Compiling it three times resolves the issue. The problem with the first column still remains however.

  • 1
    If I compile your example code 3 times (until the longtable waring "Column widths have changed" is no longer present), I get the following output: i.stack.imgur.com/rMV5g.png. I can't see the misalignment of "Quadrant" with respect to the numbers there.
    – leandriis
    Jul 26, 2020 at 13:54
  • As leandriis points out, you only need to compile 3 times for the alignment to be correct.
    – AndréC
    Jul 26, 2020 at 14:09
  • @leandriis mit with respect to the numbers, but @{} should remove the whitespace in the first column
    – fuj36840
    Jul 26, 2020 at 16:09

1 Answer 1


I found out what caused the white space in the first column. I specified the column type twice, which leads to the white space. Deleting one solves the issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .