带有长表的额外对齐标签

带有长表的额外对齐标签

我正在使用longtable,但出现了错误,! Extra alignment tab has been changed to \cr.我尝试修复它,但似乎没有效果。下面是表格的代码

  \centering
    \begin{longtable}{rrrrrrrrrrrrrrrrp{2cm}}
    \caption{A Table Depicting the Relationship between Meat, Fruit, Oil}
   Oil (Barrels) & Fruit (Ton) && Meat (Ton) & Fruit (Ton) && Meat (Ton) & Oil (Barrel) & Oil (Barrels) & Fruit (Ton) & & Meat (ton)  & Fruit (ton) &       & Meat (ton)  & Oil (barrel)  \\
\hline
    0     & 500   &       & 0     & 500   &       & 0     & 600   & 0     & 12050   &         & 0     & 12050 &       & 0     & 14460 \\
    10    & 491.5 &       & 50    & 466.6 &       & 50    & 560   & 1000  & 11216.6 &         & 1500  & 11050 &       & 1500  & 13260 \\
    24    & 480   &       & 100   & 433.3 &       & 100   & 520   & 2000  & 10383.3 &         & 3000  & 10050 &       & 3000  & 12060 \\
    42    & 465   &       & 150   & 400   &       & 150   & 480   & 3000  & 9550    &         & 4500  & 9050  &       & 4500  & 10860 \\
    48    & 460   &       & 200   & 366.6 &       & 200   & 440   & 4000  & 8716.6  &         & 6000  & 8050  &       & 6000  & 9660 \\
    50    & 458.3 &       & 250   & 333.3 &       & 250   & 400   & 5000  & 7883.3  &         & 7500  & 7050  &       & 7500  & 8460 \\
    75    & 437.5 &       & 300   & 300   &       & 300   & 360   & 6000  & 7050    &         & 9000  & 6050  &       & 9000  & 7260 \\
    100   & 416.6 &       & 350   & 266.6 &       & 350   & 320   & 7000  & 6216.6  &         & 10500 & 5050  &       & 10500 & 6060 \\
    150   & 375   &       & 400   & 233.3 &       & 400   & 280   & 8000  & 5383.3  &         & 12000 & 4050  &       & 12000 & 4860 \\
    200   & 333.3 &       & 450   & 200   &       & 450   & 240   & 9000  & 4550    &         & 13500 & 3050  &       & 13500 & 3660 \\
    250   & 291.5 &       & 500   & 166.6 &       & 500   & 200   & 10000 & 3716.6  &         & 15000 & 2050  &       & 15000 & 2460 \\
    300   & 250   &       & 550   & 133.3 &       & 550   & 160   & 11000 & 2883.3  &         & 16500 & 1050  &       & 16500 & 1260 \\
    400   & 166.6 &       & 600   & 100   &       & 600   & 120   & 12000 & 2050    &         & 18000 & 50    &       & 18000 & 60 \\
    500   & 83.3  &       & 650   & 66.6  &       & 650   & 80    & 13000 & 1216.6  &         & 18075 & 0     &       & 18075 & 0 \\
    600   & 0     &       & 700   & 33.3  &       & 700   & 40    & 14000 & 383.3   &         &       &       &       &       &  \\
          &       &       & 750   & 0     &       & 750   & 0     & 14460 & 0       &         &       &       &       &       & \\
\hline
\end{longtable}%

答案1

你忘记了\caption{...}\\

它就像表格中的多列和一行。

以下只是一个让它变小的想法:

\documentclass[parskip=half]{scrartcl}
\usepackage{longtable,graphicx}
\def\RB#1{\rotatebox{90}{#1}}
\begin{document}

\begin{table}[!htb]
 \caption{A Table Depicting the Relationship between Meat, Fruit, Oil}

\resizebox{\linewidth}{!}{\tabcolsep=2pt%
 \begin{tabular}{*{16}r p{2cm}}
  \RB{Oil (Barrels)} & \RB{Fruit (Ton)} && \RB{Meat (Ton)} & \RB{Fruit (Ton)} && \RB{Meat (Ton)} & \RB{Oil (Barrel)} & \RB{Oil (Barrels)} & \RB{Fruit (Ton)} & & \RB{Meat (ton)}  & \RB{Fruit (ton)} &       & \RB{Meat (ton)}  & \RB{Oil (barrel)}  \\
\hline
    0     & 500   &       & 0     & 500   &       & 0     & 600   & 0     & 12050   &         & 0     & 12050 &       & 0     & 14460 \\
    10    & 491.5 &       & 50    & 466.6 &       & 50    & 560   & 1000  & 11216.6 &         & 1500  & 11050 &       & 1500  & 13260 \\
    24    & 480   &       & 100   & 433.3 &       & 100   & 520   & 2000  & 10383.3 &         & 3000  & 10050 &       & 3000  & 12060 \\
    42    & 465   &       & 150   & 400   &       & 150   & 480   & 3000  & 9550    &         & 4500  & 9050  &       & 4500  & 10860 \\
    48    & 460   &       & 200   & 366.6 &       & 200   & 440   & 4000  & 8716.6  &         & 6000  & 8050  &       & 6000  & 9660 \\
    50    & 458.3 &       & 250   & 333.3 &       & 250   & 400   & 5000  & 7883.3  &         & 7500  & 7050  &       & 7500  & 8460 \\
    75    & 437.5 &       & 300   & 300   &       & 300   & 360   & 6000  & 7050    &         & 9000  & 6050  &       & 9000  & 7260 \\
    100   & 416.6 &       & 350   & 266.6 &       & 350   & 320   & 7000  & 6216.6  &         & 10500 & 5050  &       & 10500 & 6060 \\
    150   & 375   &       & 400   & 233.3 &       & 400   & 280   & 8000  & 5383.3  &         & 12000 & 4050  &       & 12000 & 4860 \\
    200   & 333.3 &       & 450   & 200   &       & 450   & 240   & 9000  & 4550    &         & 13500 & 3050  &       & 13500 & 3660 \\
    250   & 291.5 &       & 500   & 166.6 &       & 500   & 200   & 10000 & 3716.6  &         & 15000 & 2050  &       & 15000 & 2460 \\
    300   & 250   &       & 550   & 133.3 &       & 550   & 160   & 11000 & 2883.3  &         & 16500 & 1050  &       & 16500 & 1260 \\
    400   & 166.6 &       & 600   & 100   &       & 600   & 120   & 12000 & 2050    &         & 18000 & 50    &       & 18000 & 60 \\
    500   & 83.3  &       & 650   & 66.6  &       & 650   & 80    & 13000 & 1216.6  &         & 18075 & 0     &       & 18075 & 0 \\
    600   & 0     &       & 700   & 33.3  &       & 700   & 40    & 14000 & 383.3   &         &       &       &       &       &  \\
          &       &       & 750   & 0     &       & 750   & 0     & 14460 & 0       &         &       &       &       &       & \\
\hline
\end{tabular}}%
\end{table}

\end{document}

在此处输入图片描述

答案2

您需要\\ (或\endhead)之后\caption{}

相关内容