我有一张长表,我的文档的类别是 IEEETran,但是通过使用本问题中介绍的解决方案隐藏页面下方表格中的大量行,我的表格错误地显示为两列。我需要我的表格显示在我的页面中,其余部分显示在下一页中。
\documentclass[10pt,journal,compsoc]{IEEEtran}
\begin{longtblr}
[% caption and label
caption={Summary of models},
label={demo-table}
]
{% format
colspec={XX[0.5]X[2]X[1.3]XX},
hlines,vlines,
rowhead=1,
cells={font=\footnotesize}
}% content
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s) \\
\centering Model& \centering Year & \centering Input & \centering Architecture(s) & \centering Backbone(s) & Dataset(s)
\end{longtblr}
下图显示了输出(表格的其余部分位于以下列,如文本,但表格的整体形式相同,但一些文本超出了表格的框架):
我该如何解决这个问题?
答案1
- 您的文档示例不完整。请使其可编译,因为我们已在评论中要求您这样做。
- 提供的代码片段非常混乱。请熟悉
tabularraY
该软件包。它有写得很好的说明文档。您可以在软件包安装中找到它,也可以在加拿大运输安全局。 - 请使单元格的内容更加真实,到目前为止单元格中只有一个单词,因此表格仅占据列高的 3/4。
- 为了获得帮助,请帮助我们了解您的问题,下面的 MWE 是基于猜测的。
- 对于起点,请参见下面的 MWE,其编译结果与您在相关图像中显示的结果相差甚远。
\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{lipsum}
\usepackage{tabularray}
\begin{document}
\lipsum[1-3]
\begin{longtblr}[% caption and label
caption = {Summary of models},
label = {demo-table}
]{% format
hlines,vlines,
colspec = {ll X[l] X[0.7, j, cmd=\hskip 0pt] X[l]X[l]},
colsep = 3pt,
cells = {font=\footnotesize},
row{1} = {m},
rowhead = 1,
}
% column header(s)
Model & Year & Input & Architecture(s)
& Backbone(s) & Dataset(s) \\
% table body
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
Model & Year & Input & CCN & Custom & Dataset 1 \\
\end{longtblr}
\lipsum[4-6]
\end{document}