将多列表格放入双列页面

将多列表格放入双列页面

我想将多行表格放入一页。即使我将 l 替换为 ,表格仍然无法容纳p{4cm}。我已附上我的代码和屏幕截图。

党卫军

\begin{table}[]
\begin{tabular}{@{}lllll@{}}
\toprule
\textbf{Clustering Method}    & \textbf{Features}                                                                      & \textbf{Ref.}                                                                                                     &                       &                       \\ \midrule
\textbf{K-means}              & Sensitive to the number of clusters specified {[}9{]}                                  & \multicolumn{1}{l|}{Segmentation of heat consumption intensity to characterise building behaviour at urban scale} & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Only minimises distance within cluster                                                 & \multicolumn{1}{l|}{Classification of spatio-temporal electricity demand profiles at urban scale}                 & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Does not work well with outliers                                                       & \multicolumn{1}{l|}{Classify heat exchange station based on the smart meter recordings}                           & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Only clusters spherical shape data                                                     & \multicolumn{1}{l|}{Clustering energy performance in European buildings}                                          & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
\textbf{Jenks Natural Breaks} & Depends on the number of breaks specified                                              & \multicolumn{1}{l|}{Classification of geothermal potential}                                                       & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Minimises distance within cluster and maximises the deviation between cluster {[}10{]} & \multicolumn{1}{l|}{Default classification method on mapping software}                                            & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Performs well in heavily-skewed data {[}11{]}                                          & \multicolumn{1}{l|}{Differentiation of ecosystem bundles for landscape planning}                                  & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
\textbf{DBSCAN}               & {\ul Number of clusters need not be specified}                                         & \multicolumn{1}{l|}{Disaggregation of electrical meter data to identify distinct groups of loads}                 & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Separate high density data points from low density data points                         & \multicolumn{1}{l|}{Clustering West Nile Virus spatio-temporal data}                                              & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Handles outliers efficiently                                                           & \multicolumn{1}{l|}{}                                                                                             & \multicolumn{1}{l|}{} & \multicolumn{1}{l|}{} \\
                              & Can identify arbitrary shape data                                                      &                                                                                                                   &                       &                       \\ \bottomrule
\end{tabular}
\end{table}

答案1

一些意见和建议。

  • 首先,去掉所有\multicolumn{1}{l|}{...}包装纸。
  • 特别是,摆脱那些毫无意义的\multicolumn{1}{l|}{}指令。
  • 我看不出有什么理由将表格指定为有 5 列,因为实际上只有 3 列。
  • 允许在所有三个实际列中自动换行。
  • 我建议你采用一个tabularx环境。
  • 既然、、等也能达到同样的效果,为什么还要写{[}9{]}、、等呢?{[}10{]}[9][10]
  • 我没有\textbf从你的代码中删除这些指令。但是,我认为它们没有必要。恕我直言,它们既不必要,又有点粗俗。不要过度使用粗体。

在此处输入图片描述

\documentclass[twocolumn]{article} % or some other suitable document class
\usepackage[british]{babel} % 'minimise', 'behaviour', etc. 
\usepackage{booktabs,tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight}X}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1}}
\newlength\mylen
\settowidth\mylen{\textbf{Clustering Method}} % set width of first column
\begin{document}

\begin{table*} % make the table span both columns
\setlength\extrarowheight{2pt} 
\begin{tabularx}{\textwidth}{@{} P{\mylen} L L @{}} % 3 columns, not 5
\toprule
\textbf{Clustering Method} & \textbf{Features} & \textbf{Ref.} \\ 
\midrule
\textbf{K-means} 
   & Sensitive to the number of clusters specified~[9] 
   & Segmentation of heat consumption intensity to characterise building behaviour at urban scale \\
   & Only minimises distance within cluster 
   & Classification of spatio-temporal electricity demand profiles at urban scale \\
   & Does not work well with outliers 
   & Classify heat exchange station based on the smart meter recordings \\
   & Only clusters spherical shape data 
   & Clustering energy performance in European buildings \\
\textbf{Jenks Natural Breaks} 
   & Depends on the number of breaks specified 
   & Classification of geothermal potential\\
   & Minimises distance within cluster and maximises the deviation between cluster~[10] 
   & Default classification method on mapping software \\
   & Performs well in heavily-skewed data~[11] 
   & Differentiation of ecosystem bundles for landscape planning  \\
\textbf{DBSCAN} 
   & Number of clusters need not be specified 
   & Disaggregation of electrical meter data to identify distinct groups of loads \\
   & Separate high density data points from low density data points 
   & Clustering West Nile Virus spatio-temporal data \\
   & Handles outliers efficiently \\
   & Can identify arbitrary shape data \\ 
\bottomrule
\end{tabularx}
\end{table*}

\end{document}

相关内容