拆分横向长桌

拆分横向长桌

我尝试自己解决这个问题。但是,似乎没有什么效果。我有一张超长的桌子,但它的格式与普通桌子不同,因为它是水平方向的。如果可以的话,我希望保持这种状态。目前的问题是它

  1. 对于水平页面来说,一行太宽了。我想按比例缩放,使宽度/高度适合一页。
  2. 表格总是从页面右侧/顶部超出范围。如果可能的话,我想将其拆分,以便它跨越多个页面。

任何帮助将不胜感激!

这是我目前所拥有的:

\begin{landscape}
\begin{longtable}[c]{@{}lllccccccccccccccccccccccccccccc@{}}
\toprule
Dimensionen   englisch &
  Dimensionen   deutsch &
  Definition &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}1} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}2} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}3} &
.... and a way more removed because marked as spam
  \multicolumn{1}{l}{\cellcolor[HTML]{9BC2E6}29} \\* \midrule
\endfirsthead
%
\multicolumn{32}{c}%
{{\bfseries Table \thetable\ continued from previous page}} \\
\endhead
%
\bottomrule
\endfoot
%
\endlastfoot
%
Timeliness &

.....a thousand &; SE marked it as spam
   \\* \bottomrule
\caption{Dimensionen der Wissensqualität}
\label{tab:Wissensqualittsdimensionen}\\
\end{longtable}
\end{landscape}
\begin{landscape}
\begin{longtable}[c]{@{}lllccccccccccccccccccccccccccccc@{}}
\toprule
Dimensionen   englisch &
  Dimensionen   deutsch &
  Definition &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}1} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}2} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}3} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}4} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}5} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}6} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}7} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}8} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}9} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}10} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}11} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}12} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}13} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}14} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}15} &
  \multicolumn{1}{l}{\cellcolor[HTML]{BDD7EE}16} &
  \multicolumn{1}{l}{\cellcolor[HTML]{DDEBF7}17} &
  \multicolumn{1}{l}{\cellcolor[HTML]{9BC2E6}18} &
  \multicolumn{1}{l}{\cellcolor[HTML]{9BC2E6}19} &
  \multicolumn{1}{l}{\cellcolor[HTML]{9BC2E6}20} &
  \multicolumn{1}{l}{\cellcolor[HTML]{9BC2E6}21} &
.... and a few more removed because marked as spam

\endfirsthead
%
\multicolumn{32}{c}%
{{\bfseries Table \thetable\ continued from previous page}} \\
\endhead
%
\bottomrule
\endfoot
%
\endlastfoot
%
Timeliness &
  Aktualität &
  aktuell &
  x &
.....a thousand &; SE marked it as spam

   \\* \bottomrule
\caption{Dimensionen der Wissensqualität}
\label{tab:Wissensqualittsdimensionen}\\
\end{longtable}
\end{landscape}

它看起来像这样:

[1]:https://i.stack.imgur.com/CTjTJ.png

编辑:感谢所有试图帮助我的人,我找到了一个解决方法,也许它可以帮助某些人。我使用几何包来更改我想要的表格部分的边距,以便表格的宽度适合一页。我将表格分成 4 个部分以适合页面的高度。也许这不是最优雅的解决方案。但是,它有效。如果我的描述不够清楚,请原谅,再次感谢大家的帮助!

现在看起来是这样的: 解决方案

答案1

这是一个小的示例表,说明了我之前关于如何使表格变窄以适合可用空间的建议。

我合并了两个“Dimensionen”列,因为它们都包含基本相同的信息,只是使用两种不同的语言。使用X来自的类型列,xltabular我确保在“Dimensionen”和“Definition”列中允许换行。使用wc类型列,我确保所有后续 32 列具有相同的宽度,同时水平居中。为了节省更多空间,我将字体大小减小到,\footnotesize并将列之间的水平空白(\tabcolsep)从原来的减小6pt2pt。如果您使用具有较大文本块的其他文档类,您可能能够将字体大小增加到\small。最后,我用单个字母替换了最后 32 列中的单词,并使用threeparttablex包在表格下方解释这些单个字母的缩写。使用当前设置,此解释部分将在表格的每一页上重复。

在此处输入图片描述

\documentclass{article}
\usepackage{xltabular}
\usepackage{threeparttablex}
\usepackage{pdflscape}
\usepackage{booktabs}
\usepackage{makecell}

\begin{document}

\begin{landscape}
\setlength{\tabcolsep}{2pt}
\footnotesize
\begin{ThreePartTable}
\begin{TableNotes}[flushleft, para]
a)~some text; b)~some other text; c)~more text; d)~more text; e)~more text; 
\end{TableNotes}
\begin{xltabular}{\linewidth}{*{2}{>{\raggedright\arraybackslash}X@{\hspace{2\tabcolsep}}} *{32}{wc{1em}}}
\caption{Dimensionen der Wissensqualität} \label{tab:Wissensqualittsdimensionen}\\
\toprule
Dimensionen englisch (deutsch) & Definition & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 & 32 \\
\midrule
\endfirsthead
\caption{Dimensionen der Wissensqualität - continued from previous page}\\
\toprule
Dimensionen englisch (deutsch) & Definition & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 & 28 & 29 & 30 & 31 & 32 \\
\midrule
\endhead
\bottomrule
\insertTableNotes
\endfoot
Interpretability (Interpretierbarkeit) & entsprechende Sprache, Symbole, Einheiten 
  & x  & a) & x  & x  & x  & x  & x  & a) 
  & x  & x  & x  & b) & x  & x  & x  & a) 
  & x  & x  & x  & a) & x  & x  & x  & c) 
  & x  & x  & x  & x  & x  & x  & x  & x  \\
\addlinespace
Concise representation (Prägnante Darstellung)  & kompakt dargestellt 
  & x  & x  & d) & x  & a) & x  & x  & x 
  & x  & x  & x  & b) & x  & x  & x  & e) 
  & x  & x  & x  & a) & x  & x  & d) & x 
  & x  & x  & x  & x  & x  & x  & x  & x  \\
\end{xltabular}
\end{ThreePartTable}
\end{landscape}


\end{document}

相关内容