![使表格适合页面](https://linux22.com/image/459336/%E4%BD%BF%E8%A1%A8%E6%A0%BC%E9%80%82%E5%90%88%E9%A1%B5%E9%9D%A2.png)
我试图将此表放入页面中,但不幸的是它不起作用。问题是,这是一个补充表,所以我使用:
\DeclareFloatingEnvironment[name={Supplementary Table},fileext=lst,listname={List of Supplementary Tables}]{supptable}
进而:
\begin{supptable}[bp]
\rotatebox{90}{
\vbox{
\begin{tabularhtx}{\textwidth}{\textheight}{|X|X|X|X|X|X|X|X|X|X|}
\hline
&\textbf{DACHS} & \textbf{QUASAR} & \textbf{TCGA} & \textbf{NLCS} & \textbf{YCR-BCIP} & \textbf{DUSSEL} & \textbf{MECC} & \textbf{UMM} & \textbf{MUNICH}\\
\hline
Origin & Germany & United Kingdom & United States & The Netherlands & United Kingdom & Germany & Israel & Germany & Germany \\
\hline
\end{tabularhtx}
\caption{Test supplementary table 1}
\label{supplTable1}
}
}
\end{supptable}
我需要移动桌子。你能帮我吗?
答案1
- 你应该提供 MWE(最小工作示例),一个完整的小文档,可以重现你的问题
- 从您的代码片段不可能确定您的页面布局,因此在下面的 MWE 中预计对于文档类使用包的
\article
默认设置对于页面布局使用geometry
包的默认设置。 - 对于你的桌子我会用
- 横向页面方向
tabularray
桌子包装\small
字体大小- 减小列分隔宽度(3pt)
\documentclass{article}
\usepackage{geometry}
\usepackage{lipsum}
\usepackage{pdflscape}
\usepackage{caption}
\usepackage{tabularray}
\usepackage{newfloat}
\DeclareFloatingEnvironment[name={Supplementary Table},
fileext=lsst,
listname={List of Supplementary Short Tables},
within=section, placement=htbp!]{supptable}
\begin{document}
\listofsupptables
\clearpage
\begin{landscape}
\begin{supptable}
\begin{tblr}{hlines, vlines,
colspec = {Q[c, m]*{9}{X[c, m]} },
colsep = 2pt,
row{1} = {font=\small\bfseries}
}
& DACHS & QUASAR & TCGA & NLCS & YCR-BCIP
& DUSSEL & MECC & UMM & MUNICH \\
Origin & Germany & United Kingdom
& United States
& The Netherlands
& United Kingdom
& Germany & Israel & Germany & Germany \\
\end{tblr}
\captionof{table}{Test supplementary table 1}
\label{supplTable}
\end{supptable}
\lipsum[66]
\end{landscape}
\end{document}