0

Consider the following code:

\begin{center}
\begin{longtable}{|l|l|l|l|}
\caption{Resistencia $R$ en funcion de la temperatura $t$ para un metal noble} \label{res-metal} \\

\hline 
    \multicolumn{1}{|l|}{t (ºC)} 
    & \multicolumn{1}{|l|}{$\Delta t$} 
    & \multicolumn{1}{|l|}{$R (\Omega)$} 
    & \multicolumn{1}{|l|}{$\Delta \Omega$} \\ 
\hline
\endfirsthead

\multicolumn{4}{l}%
{{\bfseries \tablename\ \thetable{} -- continua de la página anterior}} \\
\hline 
    \multicolumn{1}{|l|}{t (ºC)} 
    & \multicolumn{1}{|l|}{$\Delta t$} 
    & \multicolumn{1}{|l|}{$R (\Omega)$} 
    & \multicolumn{1}{|l|}{$\Delta \Omega$} \\ 
\hline
\endhead

\hline 
    \multicolumn{4}{|l|}{{continua en la siguiente página}} \\ 
\hline
\endfoot

\hline \hline
\endlastfoot

    300 & 1 & 228 & 2 \\ \hline
    295 & 1 & 226 & 2 \\ \hline
    290 & 1 & 224 & 2 \\ \hline
    285 & 1 & 221 & 2 \\ \hline
    280 & 1 & 219 & 2 \\ \hline
    275 & 1 & 217 & 2 \\ \hline
    270 & 1 & 214 & 2 \\ \hline
    265 & 1 & 212 & 2 \\ \hline
    260 & 1 & 210 & 2 \\ \hline
    255 & 1 & 208 & 2 \\ \hline
    250 & 1 & 206 & 2 \\ \hline
    245 & 1 & 203 & 2 \\ \hline
    240 & 1 & 201 & 2 \\ \hline
    235 & 1 & 199 & 2 \\ \hline
    230 & 1 & 197 & 2 \\ \hline
    225 & 1 & 195 & 2 \\ \hline
    220 & 1 & 193 & 2 \\ \hline
    215 & 1 & 191 & 2 \\ \hline
    210 & 1 & 188 & 2 \\ \hline
    205 & 1 & 186 & 2 \\ \hline
    200,0 & 0,1 & 184 & 1 \\ \hline
    195,5 & 0,1 & 182 & 1 \\ \hline
    190,0 & 0,1 & 180 & 1 \\ \hline
    185,0 & 0,1 & 177 & 1 \\ \hline
    180,0 & 0,1 & 175 & 1 \\ \hline
    175,0 & 0,1 & 173 & 1 \\ \hline
    170,0 & 0,1 & 171 & 1 \\ \hline
    165,5 & 0,1 & 169 & 1 \\ \hline
    160,0 & 0,1 & 167 & 1 \\ \hline
    155,0 & 0,1 & 165 & 1 \\ \hline
    150,0 & 0,1 & 163 & 1 \\ \hline
    145,0 & 0,1 & 160 & 1 \\ \hline
    140,0 & 0,1 & 158 & 1 \\ \hline
    135,0 & 0,1 & 156 & 1 \\ \hline
    130,0 & 0,1 & 154 & 1 \\ \hline
    125,0 & 0,1 & 152 & 1 \\ \hline
    120,0 & 0,1 & 150 & 1 \\ \hline
    115,0 & 0,1 & 148 & 1 \\ \hline
    110,0 & 0,1 & 146 & 1 \\ \hline
    105,0 & 0,1 & 144 & 1 \\ \hline
    100,0 & 0,1 & 142 & 1 \\ \hline
    95,0 & 0,1 & 140 & 1 \\ \hline
\end{longtable}
\end{center}

gives the following output (cropped at pagebreak):

enter image description here

Why does the last column have so much whitespace? I would understand that the last column would span until the last character of the last row in that page, but not its actual behaviour.

4
  • 2
    you have not provided code in a form that we can run but presumably there is a wide entry somewhere (longtable makes the columns the same widths on all pages) unrelated but never put longtable in a center environment Mar 10, 2021 at 8:40
  • 2
    th ewide entry is probably \multicolumn{4}{l}% {{\bfseries \tablename\ \thetable{} -- continua de la página anterior Mar 10, 2021 at 8:42
  • Indeed it was the wide entry, thanks. So longtables does not only take into account the rows of data. If you with to post as an answer I would gradle accept
    – J L
    Mar 10, 2021 at 8:50
  • the heading columns have to fit over the table columns! (in general, longtable did not know that was a "caption" as you didn't use the capotion commands) Mar 10, 2021 at 9:26

1 Answer 1

1

You have a wide entry in the heading

 \multicolumn{4}{l}% {{\bfseries \tablename\ \thetable{} 

forcing the 4th column to be wide.

The longtable \caption commands are essentially \multicolumn but hide the text width to avoid this problem you could have used \caption[]{...} where the [] prevents multiple captions being written to the list of tables.

You must log in to answer this question.

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