我想创建一个单列文档格式的两页表格,但我做不到。我已经使用了“longtable”和“supertabular”使用包,但没有结果,请告诉我如何创建多页表格?
编辑:
以下是 op 在其评论中提供的代码:
\begin{table*}[!p]
\renewcommand{\arraystretch}{1.9}
\caption{Classification }
\label{Comparison}
\centering
\begin{tabular}{|p{2.2cm}|p{2cm}|p{5cm}|p{3cm}|}
\hline
\bfseries Sensor Type & \bfseries Sensing Approach & \bfseries Deliverables & \bfseries Reference\\
\hline
PIR & Conventional & Energy saving, & \\ \hline CO2 &Conventional& Electricity forecast estimation& \\
\hline
Camera & Conventional & Building energy management, & \\
\hline
Ultrasonic & Conventional & Head count, person identification, presence detection& \\
\hline
\end{tabular}
\end{table*}
答案1
根据发布的代码,我了解到您没有尝试使用标准编码格式longtable
。supertabular
请按照这些软件包的文档进行操作,如果您仍然遇到任何问题,请发布您的MWE
问题...
答案2
让我详细阐述一下上述评论。可能的解决方案似乎是手动将表格分成两部分,并使用和包caption
将第一个表格放在同一页面的底部(如果有必要的话)。例如:\ContinuedFloat
stfloat
\documentclass[twocolumn]{article}
\usepackage{stfloats}
\usepackage{caption}
\usepackage{array, booktabs, makecell}
\renewcommand\theadfont{\bfseries\normalsize}
%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}
\begin{document}
\lipsum[11]
\begin{table*}[b]
\caption{Classification}
\label{Comparison}
\centering
\begin{tabular}{p{1.5cm} p{2cm} p{6cm} p{4cm} }
\toprule
\thead[b]{Sensor\\ Type}
& \thead[b]{Sensing\\ Approach}
& \thead[b]{Deliverables}
& \thead[b]{Reference} \\
\midrule
PIR & Conventional & \lipsum*[11] & \\
\addlinespace
CO2 & Conventional & \lipsum*[11] & \\
\bottomrule
\end{tabular}
\end{table*}
\begin{table*}[t]
\ContinuedFloat,
\caption{Classification (cont.)}
\centering
\begin{tabular}{p{1.5cm} p{2cm} p{6cm} p{4cm} }
\toprule
\thead[b]{Sensor\\ Type}
& \thead[b]{Sensing\\ Approach}
& \thead[b]{Deliverables}
& \thead[b]{Reference} \\
\midrule
Camera & Conventional & \lipsum*[11] & \\
\addlinespace
Ultrasonic & Conventional & \lipsum*[11] & \\
\bottomrule
\end{tabular}
\end{table*}
\lipsum[1-4]
\end{document}
其中lipsum
用于模拟带有单元格中虚拟文本的更长的表格。这给出:
\documentclass[twocolumn]{article}
\usepackage{stfloats}
\usepackage{caption}
\usepackage{array, booktabs, makecell}
\renewcommand\theadfont{\bfseries\normalsize}
%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}
\begin{document}
\lipsum[11]
\begin{table*}[b]
\caption{Classification}
\label{Comparison}
\centering
\begin{tabular}{p{1.5cm} p{2cm} p{6cm} p{4cm} }
\toprule
\thead[b]{Sensor\\ Type}
& \thead[b]{Sensing\\ Approach}
& \thead[b]{Deliverables}
& \thead[b]{Reference} \\
\midrule
PIR & Conventional & \lipsum*[11] & \\
\addlinespace
CO2 & Conventional & \lipsum*[11] & \\
\bottomrule
\end{tabular}
\end{table*}
\begin{table*}[t]
\ContinuedFloat,
\caption{Classification (cont.)}
\centering
\begin{tabular}{p{1.5cm} p{2cm} p{6cm} p{4cm} }
\toprule
\thead[b]{Sensor\\ Type}
& \thead[b]{Sensing\\ Approach}
& \thead[b]{Deliverables}
& \thead[b]{Reference} \\
\midrule
Camera & Conventional & \lipsum*[11] & \\
\addlinespace
Ultrasonic & Conventional & \lipsum*[11] & \\
\bottomrule
\end{tabular}
\end{table*}
\lipsum[1-4]
\end{document}
注意:红线仅显示页面布局。在实际文档中您应该删除包showframe
。