我正在尝试将一个较长的横向表格拆分成多个页面,但不拆分行。我发现我们应该使用longtable
横向包,但这样做行不通。代码如下:
\documentclass[11pt]{article}
\usepackage{standalone}
\usepackage{float}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[paper=a4paper, left=3.0cm, right=3.0cm, top=1cm, bottom=1cm]{geometry}
\usepackage{ccaption}
\usepackage{array}
\usepackage{caption}
\usepackage[caption=false]{subfig}
\usepackage{tipa}
\usepackage{ctable}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{lipsum}
\begin{document}
\begin{landscape}
\begin{table}
\scriptsize
\centering
\newcommand{\otoprule}{\midrule[0.08em]}
\caption{caption name}
\label{tab:tabsone}
% *{15}{p{1cm}}
\begin{longtable}{@{}p{0.7cm}p{1cm}p{1.5cm}p{2cm}p{1cm}p{0.7cm}p{1.3cm}p{1.3cm}p{1.5cm}p{1.5cm}p{1.3cm}p{1.5cm}p{2cm}p{1.6cm}p{1.9cm}@{}}
\toprule
Study & Cancer & Conditions & Cell Subtype/ Treatment & Patients & Cell Line & Technique & RNAseq Library & Sequencing Platform & Microarray & Array Platform & Dataset Ids & Publication Citation & Comments & Criteria study inclusion\\ \otoprule
A2.2.2 & hsjsjjsj & \lipsum[66] & \lipsum[66] & jsjsjsjs & jsjsjsj & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] & \lipsum[66] \\ \midrule
O2.h.13 & hshshshs & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] \\ \midrule
\lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \\ \midrule
N5.10.2.OP & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] \\ \bottomrule
\end{longtable}
\end{table}
\end{landscape}
\end{document}
答案1
环境的内容table
不能跨页拆分。因此,删除table
环境并将\caption
命令移至 内部longtable
。(但不要忘记或\\
之后的)。对于重复的列标题,请使用和。\aption
\label
\endhead
\endfirsthead
这是代码的修正版本。但请注意,表格仍然溢出到第 2 页和第 3 页的边距中。这是因为分页符只能发生在表格行之间,而不能发生在表格行内。由于表格列很窄,并且包含的文本比较多,因此单个表格行的高度高于可用空间。希望实际表格的内容更短一些。
\documentclass[11pt]{article}
\usepackage[paper=a4paper, left=3.0cm, right=3.0cm, top=1cm, bottom=1cm]{geometry}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{pdflscape}
\usepackage{lipsum}
\begin{document}
\begin{landscape}
\scriptsize
\newcommand{\otoprule}{\midrule[0.08em]}
% *{15}{p{1cm}}
\begin{longtable}{@{}p{0.7cm}p{1cm}p{1.5cm}p{2cm}p{1cm}p{0.7cm}p{1.3cm}p{1.3cm}p{1.5cm}p{1.5cm}p{1.3cm}p{1.5cm}p{2cm}p{1.6cm}p{1.9cm}@{}}
\caption{caption name}
\label{tab:tabsone}\\
\toprule
Study & Cancer & Conditions & Cell Subtype/ Treatment & Patients & Cell Line & Technique & RNAseq Library & Sequencing Platform & Microarray & Array Platform & Dataset Ids & Publication Citation & Comments & Criteria study inclusion\\ \otoprule \endfirsthead
\caption{caption name -- continued from previous page}\\
\toprule
Study & Cancer & Conditions & Cell Subtype/ Treatment & Patients & Cell Line & Technique & RNAseq Library & Sequencing Platform & Microarray & Array Platform & Dataset Ids & Publication Citation & Comments & Criteria study inclusion\\ \otoprule \endhead
A2.2.2 & hsjsjjsj & \lipsum[66] & \lipsum[66] & jsjsjsjs & jsjsjsj & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] & \lipsum[66] \\ \midrule
O2.h.13 & hshshshs & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] \\ \midrule
\lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \\ \midrule
N5.10.2.OP & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & \lipsum[66] & & & \lipsum[66] & \lipsum[66] \\ \bottomrule
\end{longtable}
\end{landscape}
\end{document}